PDA

View Full Version : how to share a node between 2 materials ?


fabilabo
05-23-2007, 09:57 AM
hi,

i'm new to XSI (from Lightwave) and i wonder if i can share a node between 2 materials ?
For instance, i want to apply a "share" ambiant occlusion shader on 2 or more differents materials, the goal is to not have to modify both (or more) ambiant occlusion node, only the share one.

can i do it ?
thx in advance

(sorry for english ;-)

AnIm
05-23-2007, 11:03 AM
sorry, you can't do it

however, you have several possibilities:

1. link parameters of those 2 nodes together, so when you will edit first, the second will change as well (it is only one way connection)

2. almost the same as 1.
create a customProperty with all parameters that the desired shader has
link shaders parameters to them
this way you can tweak cProp parameters and have all shaders updated
and you do not have to worry about loosing link when the master shader is deleted as in method 1.

3. (only if the materials should share entire branch, like AO shader with all its inputs, and output leads into the same port on all the materials, (like diffuse input port) lets call it portA ... )
create new group with objects with those materials
set an override to this group on portA of any material
open override in render tree and plug whatever you want into it, like AO ...

4. render AO as a separate pass, it off course depends on usage of this shader in your scene

depol
05-23-2007, 12:14 PM
You can override some properties of two materials, its same share.

fabilabo
05-23-2007, 12:26 PM
Then, an another instance, i have 10 objects. I want the same shader on the 10 objects, but with a different texture locator (rotation, size etc.).

Can i have only one "share" shader, but a différents locator for each object ?

For the share node, i'm sad :-( maya can do it (in Lightwave it's very bad ...)
Thank you.

AnIm
05-23-2007, 05:30 PM
what do you mean by texture locator? if you mean texture support, then yes, you can have different texture supports on different objects with the same material

just select all objects and get->property->textureProjection and choose type of projection
each of the selected objs will now have individual texture support which can be moved rotated, scaled etc.

Atyss
05-24-2007, 12:14 AM
sorry, you can't do it

Yes you can.

But only through scripting. Now before Kim starts kicking my ass for not being elaborate, let's just say that even in scripting there is no *simple* way to do it. You have to know in advance what you want to plug in what, and getting that kind of information through scripting in an elegant fashion is not easy task. Still, if you're interested, check out the SIConnectShaderToCnxPoint() command.


Cheers
Bernard

ThE_JacO
05-24-2007, 01:30 AM
Yes you can.

But only through scripting. Now before Kim starts kicking my ass for not being elaborate

Kim is busy, but worry not, I'm looking for my combat boots as we speak to make sure unelaborateness isn't left unpunished ;)

fabilabo
05-24-2007, 10:19 AM
ok, thaks guys !

CGTalk Moderation
05-24-2007, 10:19 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.