Dup. Reference --> Instances

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Display Modes
  05 May 2013
Dup. Reference --> Instances

Hello there,
I'm currently working on a big env shot and the amount of cars is exploding right now. As we initially expected only a few vehicles to be in there (mostly vegetation) I referenced them in and just duplicated the references of the specific cars when I wanted to place multiple of the same type. The referenced file is simply a rough Proxy shape of the car's elements with links to high detail .mi files in the shape nodes (exported WITH material for the wheels and base, exported WITHOUT materials for the paint, so I could apply paint variation via the proxy shape that is referenced into the main scene)

as I said, the amount of cars is getting really high now and I have to figure out how to move from referencing to instancing without having to stage every single car again. The problem is that reference duplicates work the same as copying the meshes multiple times - the shape nodes aren't instanced but coiped, so mentalray is loading the .mi file AGAIN for every single car of the same type. So, right now, I'm looking for a nice way to convert those reference duplicates to Instances, where my transform nodes remain but the shape nodes are instanced (like car01:car01 to car10:car01 all have their separate transform nodes car01:base_msh to car10:base_msh, but share the same shape car01:base_mshShape)

I hope I could somewhat describe the problem - right now, when rendering kicks off, maya loads the reference duplicates of car01 seperately and then the .mi shapes, that are linked within them again separately......which is slow as....I can't even make up a pun to describe. So, by converting the separate objects to instances I'm hoping that the .mi files will only be loaded once, but right now I have no idea how to approach this conversion.

I'm currently working on a soultion together with our scripting guy, but maybe someone here could give us input or has even made a similar script that I could use.

thanks alot, cheers
  05 May 2013
alright, we could come up with a solution using a script that Joojaa posted here . My coworker Helmut Kriegseisen simply wrote a small script to run before the one above which does the selection work for you:

global proc hk_selT ()
string $sel[] = `ls -sl`;
string $shapes[] = `listRelatives -f -s $sel[0]`;
string $tmp[];
tokenize $sel[0] "|" $tmp;
$selN = $tmp[size($tmp)-1];

$selC = `ls -ap $selN`;
select -cl;
select -add $shapes[0];
for ($i=0; $i<size($selC); $i++)
if ($selC[$i] != $sel[0])
{select -add $selC[$i];}

so, for anyone interested, the workflow is as follows:

1) Import all the Reference Duplicates
2) Delete all namespaces of those References
3) Select one car part mesh (eg. Paint_msh) and run the hk_selT script
4) rum Joojaa's instancing script
5) Repeat for all car parts and car models
6) reapply your shader assignmants (in my case, the paint variations get lost obviously because the duplicate shapes are deleted. but reassigning my shaders is a one-klick thing, as I ot them organized in selection sets anyways)

Just thought I'd share the solution here in case someone might run into the same problem
  05 May 2013
Thread automatically closed

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.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

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
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 12:19 AM.

Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.