Integrating 3D models with photography
Interested in integrating your 3D work with the real world? This might help
# 1 05-09-2007 , 08:28 AM
Registered User
Join Date: Aug 2007
Posts: 4

Mental Ray in MEL

Hi, i want, if possible, to user the Math functions of Mental Ray into my scripts MEL. how to call, for example, the function: void mi_vector_neg( miVector *r). please, help me!!

# 2 06-09-2007 , 01:49 AM
kbrown's Avatar
Moderator
Join Date: Sep 2002
Location: London, UK
Posts: 3,198
I don't think you can do that. Maybe with python... not sure.

But for basic vector math you can just use operators (+, -, *, /, etc). There are also special commands for things like dot and cross product. Check the docs under Commands -> By Category -> Language -> Maths...


Kari
- My Website
- My IMDB

Do a lot, Fail a lot and Learn a lot!
# 3 06-09-2007 , 05:39 AM
Registered User
Join Date: Aug 2007
Posts: 4
the mi_vector_neg function is just a example, the functions than need are more complex how resolutions of linear systems , rotations matrix, ...

# 4 07-09-2007 , 01:43 AM
kbrown's Avatar
Moderator
Join Date: Sep 2002
Location: London, UK
Posts: 3,198
I'm pretty sure you cannot do that kind of stuff (directly) without plugins. Of course you could script it by programming the maths manually using lower level commands, but it probably wouldn't be efficient enough.

At work we have a MEL extension library (a set of new mel commands) which is written for things like this (and much more). If you're up to it, maybe start looking into the Maya API and learn how to create custom MEL commands? It's not too hard once you get into it. The maya API itself already contains the most common vector / matrix etc stuff.

Edit: I'm not too familiar with python but as Maya now has python bindings to the API, you could go that route too...


Kari
- My Website
- My IMDB

Do a lot, Fail a lot and Learn a lot!
# 5 07-09-2007 , 02:44 AM
vladimirjp's Avatar
Subscriber
Join Date: Jun 2003
Location: stuck in the 90's boston, USA
Posts: 1,871
yup. python has a robust math lib

Posting Rules Forum Rules
You may not post new threads | You may not post replies | You may not post attachments | You may not edit your posts | BB code is On | Smilies are On | [IMG] code is On | HTML code is Off

Similar Threads