Simply Maya User Community

Simply Maya User Community (https://simplymaya.com/forum/index.php)
-   Programming (https://simplymaya.com/forum/forumdisplay.php?f=32)
-   -   Mental Ray in MEL (https://simplymaya.com/forum/showthread.php?t=27401)

souzasan 05-09-2007 08:28 AM

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!!

kbrown 06-09-2007 01:49 AM

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...

souzasan 06-09-2007 05:39 AM

the mi_vector_neg function is just a example, the functions than need are more complex how resolutions of linear systems , rotations matrix, ...

kbrown 07-09-2007 01:43 AM

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...

vladimirjp 07-09-2007 02:44 AM

yup. python has a robust math lib


All times are GMT. The time now is 05:13 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Simply Maya 2018