View Full Version : Switch bitmap by Instance ID ?

03-19-2012, 07:04 AM
Is there a way to switch images nodes according to the instance ID?

Switch nodes do not help, as they only switch complete materials but not single image nodes.

03-19-2012, 07:07 AM
Create a second gradient, publish the inputs and hook up your images to it.


03-19-2012, 07:07 AM
duplicate the gradient thats being controlled by the instance id index and put your images into the inputs in that, and the output into the opacity?

EDIT: meh, beat me too it

03-19-2012, 07:14 AM
You may want to look at the Logic (Math>Scalar>Logic) node.

If switching between only two images the setup would be fairly simple, but if you are using multiple images you will probably have to chain a bunch of the logic nodes together.

Someone with more experience with nodes and instancing should chime in and give more useful direction.

Good luck.

Edit: 2 people with more experience with nodes and instancing already did chime in. :)

03-19-2012, 09:03 AM
Had to do the same recently, this is what I came up with (I'm no master but it worked!). B = 7 is the instance ID I'm singling out for a different texture. I this example, the output of the Logic node could be any odd number, I think. As I have 2 Material inputs, 0 is the first one, 1 is Material (2) and when it gets to the end of the material inputs it loops to the beginning Material again (sorry, just think out loud... it makes sense in my head!).

edit, on re-reading, Lightwolfs suggestion would be the one to go for!

03-19-2012, 11:37 PM
Thank you !

The gradient tip works like a charm (one must just know that the "show output" switch means "show inputs").

While typing anyway, another two questions allowed?

Is there a way to show the surface, defined by nodes, in the Modeler viewport when set to "texture view" or the Layout viewport when set to "texture shaded solid"?


When changing the surface by F5 in Layout, how to update the object in Modeler? So far, when I save in Layout -> close everything and later on start Layout and Modeler again, I get the "old" surface from Modeler instead of the changed one saved before from within Layout.

Just read the Logic Node example again. That seams to be quite powerful. Gives very fine control about when to do what.

This node thing feels more and more like a very cool feature to me.

03-20-2012, 12:59 AM

Just save your objects from Layout with "Save All Objects".

Remember that surfaces in LightWave are saved with the object file.


03-20-2012, 02:38 AM

thanks it works. Tried that in LW 10 before but made something wrong I think.
And just now I noticed, that when closing Layout and it tells me something has changed, I should have selected "save" instead of "don't save".
Missed that little setting because of blindness :-(

New eyeglasses are already ordered, but delivery is delayed. ;-)