SimplyMaya Forums

Welcome to the forum, feel free to ask questions here.

Home / forum / Animation / Mel Scripts & Programming / Mental Ray in MEL
Register FAQ Members List Calendar Mark Forums Read

New Thread
 
Thread Tools
Old 05-09-2007, 08:28 AM   #1
souzasan
Registered User
 
Join Date: Aug 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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!!
souzasan is offline   Reply With Quote
Old 06-09-2007, 01:49 AM   #2
kbrown
Moderator
 
kbrown's Avatar
 
Join Date: Sep 2002
Location: London, UK
Posts: 3,198
Thanks: 0
Thanked 8 Times in 8 Posts
Default

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!
kbrown is offline   Reply With Quote
Old 06-09-2007, 05:39 AM   #3
souzasan
Registered User
 
Join Date: Aug 2007
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

the mi_vector_neg function is just a example, the functions than need are more complex how resolutions of linear systems , rotations matrix, ...
souzasan is offline   Reply With Quote
Old 07-09-2007, 01:43 AM   #4
kbrown
Moderator
 
kbrown's Avatar
 
Join Date: Sep 2002
Location: London, UK
Posts: 3,198
Thanks: 0
Thanked 8 Times in 8 Posts
Default

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!
kbrown is offline   Reply With Quote
Old 07-09-2007, 02:44 AM   #5
vladimirjp
Subscriber
 
vladimirjp's Avatar
 
Join Date: Jun 2003
Location: stuck in the 90's boston, USA
Posts: 1,871
Thanks: 0
Thanked 4 Times in 3 Posts
Default

yup. python has a robust math lib
__________________
Image dump
vladimirjp is offline   Reply With Quote
New Thread

« Previous Thread | Next Thread »

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
MEL headache! happymat27 Members Lounge 5 05-12-2010 08:43 AM
MEL headache!! happymat27 Mel Scripts & Programming 1 03-12-2010 03:41 PM

1 Month

$34

Month-to-month billing
$34/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
 
 

3 months

$87

Billing every 3 months
$29/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
Save $5 per month or $15 in total compared to monthly billing with this package.

12 months

$288

Billing every 12 months
$24/month
Unlimited access to all videos
Project files to download
Easy to cancel at anytime
Save $10 per month or $120 in total compared to monthly billing with this package.

Your plan will automatically renew. You can cancel at any time via your PayPal account to avoid being charged again.

You can view the FAQ on our video plans here. You can contact us directly here. By clicking one of the buttons above, you agree to our Terms and Privacy Policy.