SimplyMaya Forums

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

Register FAQ Members List Calendar Mark Forums Read

New Thread
 
Thread Tools
Old 15-02-2005, 03:59 PM   #1
Velusion
Registered User
 
Velusion's Avatar
 
Join Date: May 2004
Location: Utah, USA
Posts: 368
Thanks: 0
Thanked 0 Times in 0 Posts
Default MEL referencing

I just ran into a problem with a couple of my MEL scripts when I tried to use them on a model that was referenced into the current scene.

The MEL script selects objects in the model's rigging and performs specific tasks on them. The problem is that the names of those objects have changes since they have been referenced. Instead of an object being called "rightfootgrab" it is being called "finishedmodel:rightfootgrab". Finishedmodel is the name of the scene that is being referenced. The MEL script is looking for "rightfootgrab"...

Please tell me that there is a way to write the script so that it will work on referenced models.. Otherwise, what is my option? Will I have to rename all of the objects that are being mentioned in the script?
__________________
James Rogers
www.morphicmotion.com
Velusion is offline   Reply With Quote
Old 16-02-2005, 09:30 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

Hmm... good question. Not propably the best way but you could try to search with a wild card:

select -r "*rightfootgrab";
__________________
Kari
- My Website
- My IMDB

Do a lot, Fail a lot and Learn a lot!
kbrown is offline   Reply With Quote
Old 16-02-2005, 04:48 PM   #3
Velusion
Registered User
 
Velusion's Avatar
 
Join Date: May 2004
Location: Utah, USA
Posts: 368
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Great suggestion. I'll try it tonight
__________________
James Rogers
www.morphicmotion.com
Velusion is offline   Reply With Quote
Old 23-02-2005, 08:18 PM   #4
Velusion
Registered User
 
Velusion's Avatar
 
Join Date: May 2004
Location: Utah, USA
Posts: 368
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sorry it took so long to get back. I tried it and it didn't work BUT the solution seems to be to use the NAMESPACE command. When you reference a scene into a scene, a namespace is assigned to everything in the referenced scene. By default, the referenced scene name is used as the namespace however, you can change it to whatever you want.

The easy answer is to include the name of your scene into any mel scripts that you write that will be used with the referenced scene. That way the script will be looking for the proper name.

The more complex answer would be to assign a variable as the namespace in the mel script then assign a name to it that matches the namespace of the referenced scene. By doing this, you could reference the same scene multiple times then include a short script to swap the namespace variable so that you could use the same Mel script to control all of the referenced scenes. This would be good in cases where you design a single character but want to use copies of it in a scene. By assigning a different namespace to each copy of the referenced scene and changing the namespace variable in the mel scripts you don't need a seperate script for each reference. ZoinK!
__________________
James Rogers
www.morphicmotion.com

Last edited by Velusion : 23-02-2005 at 08:20 PM.
Velusion 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.