Maya Training

Introduction to Hard Surface Modeling

Maya Training

Interiors and Furniture Vol 1 & 2 - Modeling & Cloth

Maya Training

Shading, Lighting and Rendering the Bedroom in MR

Maya Training

Robot volume one - Modeling with animation in mind

Maya Training

Spach-Alspaugh House the complete courseware

Maya Training

Burt The Cartoon Dinosaur Vol 01 - Modeling

New Maya Training

Robot Volume 02 - Hybrid Rigging
You are here > Home > SimplyMaya Community Forums
Loading

Welcome to Simply Maya

Please Sign in or Sign up for an account

Member Login

Lost your password?

Not a member yet? Sign Up!

Old 15-02-2005, 04: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, 10: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, 05: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, 09: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 09:20 PM.
Velusion is offline   Reply With Quote
Reply


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

Thread Tools





A little bit about who we are
Links you might find useful
Catch up with SimplyMaya
SimplyMaya specialises in Maya tutorials. We offer over 1,000 individual Maya training videos, ranging from basic Maya tutorials through to intermediate Maya tutorials. Our tutorials are created by instructors with industry experience and are designed to get you up and running in Maya quickly without making it seem like hard work.

Copyright © 1999-2015 SimplyMaya - vBulletin® Copyright © 2000-2015, Jelsoft Enterprises Ltd.