PDA

View Full Version : I want to be able to change texture maps for instances using Clone Instance method



Waves of light
02-28-2012, 05:54 AM
Hi,

I'm currently evaluating LW11 and started out by playing with Instancing.

I've recently finished a scene which included a Lancaster Bomber (http://forums.newtek.com/showthread.php?p=1223812#post1223812). My thought was, wouldn't it be a great time saver if I were able to use the Instance ID to change the material of a given instance, in this case the decal and insignia of different instances of the Lancaster. So bump, normals, reflection settings all stay the same.

So I reduced the scene down to one Lancaster, with one propeller (cloned 3 further times). Set up rotate and placement of the props and keyframed for MB on the props.

Now, I can get make an instance of the Lancaster using either Instance Generator or DP Instancer (the first attached image is the nodel setup to change the material of each plane) thanks Denis for popping over in the other thread and given your suggestions. But, and this maybe down to my inexperience with instancing, I don't seem to have a lot of control over the placement over my instances. I.e. I want to be able to move them into preferred positions. I also want to be able to have control over the rotation of each prop, on each instance (so that MB looks different for each prop).

So, instead I used the 'Clone instance' option from the Items | Add menu in layout. This gives me an instance of the Lancaster and of each prop. It didn't respect heirachy, but I changed that in the scene editor. However, I had complete control over placement and rotation, and it was clear it was an instance of the original, as it contained the suffix _inst.

However, the nodel set up below doesn't work. Is this because this set up, even though it is an instance, does not carry that value through to the Instance Info node?

Your suggestions are more than welcome.

Ricky.

dpont
02-28-2012, 06:45 AM
A test with instances attached to a bunch of NULLs
with LW Instancer and the Instance ID from LW Instance Info node to drive the color,
102189

As you can see, the ID number is local, always set to zero
because it is the first instance for each generator,
no way to vary the color (or material).

Same thing using DP Instancer and its own Instance Info node,
102190

the ID number is global, different for all the generators.

Denis.

Waves of light
02-28-2012, 01:20 PM
A test with instances attached to a bunch of NULLs
with LW Instancer and the Instance ID from LW Instance Info node to drive the color,
102189

As you can see, the ID number is local, always set to zero
because it is the first instance for each generator,
no way to vary the color (or material).

Same thing using DP Instancer and its own Instance Info node,
102190

the ID number is global, different for all the generators.

Denis.

Oh finally the penny drops. Sorry Denis, it wasn't the execution of the nodel setup it was how I was setting up Instance Generator or DP Instancer. I'd got it in my head, that I selected the first Lancaster Bomber, then DP Instancer, then create however many Plane instances I wanted, then look at how to manipulate each instance.

What I couldn't get through my think cranium, was I needed to add nulls and reference the Lancaster as an instance.

Ok, it looks like I have it working. However, I've noticed that MB doesn't work with instanced hierarchy items and for some reason, one of the props is missing (green plane 4th prop).

Thank you again for your help.

dpont
02-28-2012, 01:31 PM
For Motion Blurred instances,
in LW Instancer check "Parent" coordinates for the Reference,
in DP Instancer, check "Timing world" coordinates.

Denis.

Waves of light
02-28-2012, 01:41 PM
Merci Beaucoup Denis.

I will have another go in the morning. I want to try the MB and then clone the props from plane one and parent them to each plane null, so that I have full control over each of their own independent rotation.

Ricky.

Sensei
02-28-2012, 02:37 PM
Clone Instance is adding null, then in Object Properties > Instancer adds instancer where there is set reference item. And that's it.

If you're making instancing by hand, there is just one instancer, with multiple instances, so every of them gets unique number.

But while using Clone Instance tool, there is just one instance per instancer. They don't exchange InstanceID between multiple instancers.

You can try using mine Extended Item Info > Clone Index from TrueArt's Node Library. It's analyzing digits at the end of item name (in brackets), so it should work.