Hi Jan,
Try:
for i in oNode.Parameters :
if ( i.PortType == 0 ) :
print i
siPortTypeDescription
Enumerates the different kinds of ports.
C# Syntax
siPortType.siPortInput // 0
siPortType.siPortOutput // 1
ConstantValueDescriptionsiPortInput0Input port.siPortOutput1Output port.
On Tue, Mar 3, 2015 at 9:45 AM, Jan Dubied <[email protected]> wrote:
> thank you jacob
> i should have been more exact:
>
> i can get the selected shader node, but i did not post that part here.
> the only thing i cannot evaluate is if "i" (the shader parameter) is input
> or output...
>
> for exaple:
>
> for i in oNode.Parameters :
> print i
>
> this prints the parameters of the shader. in- and output.
>
> # Sources.Materials.DefaultLib.Scene_Material.Phong.Name
> # Sources.Materials.DefaultLib.Scene_Material.Phong.diffuse
> # Sources.Materials.DefaultLib.Scene_Material.Phong.specular
> # Sources.Materials.DefaultLib.Scene_Material.Phong.out
>
>
>
>
>
>
>
> On 3/3/2015 10:40 AM, Jacob Gonzalez wrote:
>
> Not sure if this is what you are trying to do, hope it helps:
>
> for param in oNode.NestedObjects:
> if param.Name == "surface":
> surfaceParam = param
>
> myOutputShader = surfaceParam.NestedObjects(0)
>
> print myOutputShader
> >>>> sphere.Material.Lambert
>
>
> On Tue, Mar 3, 2015 at 7:53 AM, Jan Dubied <[email protected]>
> wrote:
>
>> hi guys
>> any idea how i can sort out "output" ports and just query shader input
>> parameters?
>>
>> i tried this:
>>
>> for i in oNode.Parameters :
>> if ( i.PortType == siPortInput ) :
>> print i
>>
>> where oNode is the selected shader node in the render tree.
>> but it seems that PortInput is not defined...
>>
>> thanks in advance
>>
>>
>> --
>>
>> ------------------------------
>>
>> Jan Dubied
>> 2D/3D Artist
>>
>> *ON LINE VIDEO 46 AG*
>> Leutschenbachstr. 46 / 8050 Zurich / Switzerland
>> Phone +41 44 305 73 73 <%2B41%2044%20305%2073%2073> / Fax +41 44 305 73
>> 00 <%2B41%2044%20305%2073%2000>
>> www.onlinevideo.ch
>>
>
>
> --
>
> ------------------------------
>
> Jan Dubied
> 2D/3D Artist
>
> *ON LINE VIDEO 46 AG*
> Leutschenbachstr. 46 / 8050 Zurich / Switzerland
> Phone +41 44 305 73 73 / Fax +41 44 305 73 00
> www.onlinevideo.ch
>