PDA

View Full Version : Automatic import from a referenced file?


Dreppan
04-05-2007, 05:08 AM
I'm looking for a way to read in a Maya file that has multiple references, but read it in as if they were all imports. I know file -ir should work, but it keeps crashing me.

In the below example, "Test.mb" is a file fraught with namespace-referenced models.
file -ir "C:/Documents and Settings/Fellow/Desktop/Test.mb";

Just to be verbose, the namespace prefix is "REFERENCE"

Any help is appreciated.

JamesPiechota
04-06-2007, 01:12 AM
Is Test.mb already a reference in your scene?

If it isn't, then you can just to a regular import:

file -import -type "mayaAscii" -ra true -rpr "top" -options "v=0" -loadReferenceDepth "all" "C:/Documents and Settings/Fellow/Desktop/Test.mb";
This command was built by using the File > Import options and turning off "PreserverReferences"

If Test.mb is already a reference in your scene, you'll have to import it using -importReference, and then import each of its child references, and then each of their child references, etc... One way to get the child references of a given reference is (assuming Test.mb is a reference in you scene):

file -q -r "C:/Documents and Settings/Fellow/Desktop/Test.mb"

Dreppan
04-06-2007, 02:11 PM
This does work, but is there a way to

1) Read it in as imports without the namespace names?

2) If not, how do you suggest lopping off the namespaces?

Assuming every reference has the namespace "REF" -- this should work:

searchReplaceNames "REF" "" all;

but it doesn't. Suggestions?

JamesPiechota
04-07-2007, 12:53 AM
Try this:
namespace -force -moveNamespace "REF:" ":";
namespace -removeNamespace "REF:";
It should only work after the references have been collapsed by the import - you won't be able to rename referenced nodes or get rid of their namespace.

CGTalk Moderation
04-07-2007, 12:53 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.