Re: How to set the default for a color parameter in a shaderdef?

2013-07-29 Thread Stefano Jannuzzo
I found the way in jscript after reading
thishttps://groups.google.com/forum/#!searchin/xsi_list/color$20parameter$20script/xsi_list/dUrC8i2mpb4/C_gQLRfzpicJ

var paramDef = params.AddParamDef(scattering_color,
siShaderDataTypeColor3, paramOptions);
var subParamDef = paramDef.SubParamDefs;
subParamDef.GetParamDefByName(red).DefaultValue = 0.2;
subParamDef.GetParamDefByName(green).DefaultValue = 0.4;
subParamDef.GetParamDefByName(blue).DefaultValue = 0.6;


On Fri, Jul 26, 2013 at 8:37 PM, Vincent Ullmann 
vincent.ullm...@googlemail.com wrote:

  Is this in python? == True

 Am 26.07.2013 20:35, schrieb Stefano Jannuzzo:

 Thanks Vincent, Vladimir. Is this in python? It still doesn't work in
 jscript.

 On Fri, Jul 26, 2013 at 6:08 PM, Vladimir Jankijevic 
 vladi...@elefantstudios.ch wrote:

 like this: paramOptions.SetDefaultValue( [0.5, 0.3, 0.2] )


 On Fri, Jul 26, 2013 at 6:05 PM, Stefano Jannuzzo 
 stefano.jannu...@gmail.com wrote:

 Hi folks.
 In a shaderdef define function, I can create a color param and set its
 default value to a mid gray by

  paramOptions = XSIFactory.CreateShaderParamDefOptions();
 paramOptions.SetDefaultValue(0.5);
 params.AddParamDef(color, siShaderDataTypeColor3, paramOptions);

  Any idea how to set each channel independently?
 Thanks. Stefano







How to set the default for a color parameter in a shaderdef?

2013-07-26 Thread Stefano Jannuzzo
Hi folks.
In a shaderdef define function, I can create a color param and set its
default value to a mid gray by

paramOptions = XSIFactory.CreateShaderParamDefOptions();
paramOptions.SetDefaultValue(0.5);
params.AddParamDef(color, siShaderDataTypeColor3, paramOptions);

Any idea how to set each channel independently?
Thanks. Stefano


Re: How to set the default for a color parameter in a shaderdef?

2013-07-26 Thread Vincent Ullmann

Hi,

i have something like this in my Shader-Definitions:

inputParameterOptions.SetDefaultValue([1, 1, 1])



Am 26.07.2013 18:05, schrieb Stefano Jannuzzo:

Hi folks.
In a shaderdef define function, I can create a color param and set its 
default value to a mid gray by


paramOptions = XSIFactory.CreateShaderParamDefOptions();
paramOptions.SetDefaultValue(0.5);
params.AddParamDef(color, siShaderDataTypeColor3, paramOptions);

Any idea how to set each channel independently?
Thanks. Stefano





Re: How to set the default for a color parameter in a shaderdef?

2013-07-26 Thread Vladimir Jankijevic
like this: paramOptions.SetDefaultValue( [0.5, 0.3, 0.2] )


On Fri, Jul 26, 2013 at 6:05 PM, Stefano Jannuzzo 
stefano.jannu...@gmail.com wrote:

 Hi folks.
 In a shaderdef define function, I can create a color param and set its
 default value to a mid gray by

 paramOptions = XSIFactory.CreateShaderParamDefOptions();
 paramOptions.SetDefaultValue(0.5);
 params.AddParamDef(color, siShaderDataTypeColor3, paramOptions);

 Any idea how to set each channel independently?
 Thanks. Stefano




Re: How to set the default for a color parameter in a shaderdef?

2013-07-26 Thread Vincent Ullmann

Becouse it partly fits on this Topic:

Does anyone know how to set the Viewport-Mapping in a 
Python-ShaderDefinition?


In a SPDL-File you can set a it via
ui mapping

Is there a similar function for Python?



Am 26.07.2013 18:08, schrieb Vladimir Jankijevic:

like this: paramOptions.SetDefaultValue( [0.5, 0.3, 0.2] )


On Fri, Jul 26, 2013 at 6:05 PM, Stefano Jannuzzo 
stefano.jannu...@gmail.com mailto:stefano.jannu...@gmail.com wrote:


Hi folks.
In a shaderdef define function, I can create a color param and set
its default value to a mid gray by

paramOptions = XSIFactory.CreateShaderParamDefOptions();
paramOptions.SetDefaultValue(0.5);
params.AddParamDef(color, siShaderDataTypeColor3, paramOptions);

Any idea how to set each channel independently?
Thanks. Stefano






Re: How to set the default for a color parameter in a shaderdef?

2013-07-26 Thread Nicolas Burtnyk
In C++ you do this to set the diffuse ui mapping (should be simple to port
this to python):

diffuseParamDef.GetAttributes().Set(L{8C80DEF3-1064-11d3-B0B7-00A0C982A112},
 L{3515CC72-082C-11D0-91DE-00A024C78EE3});

The GUID {8C80DEF3-1064-11d3-B0B7-00A0C982A112} means ui mapping.
The GUID {3515CC72-082C-11D0-91DE-00A024C78EE3} is the XSI GUID for
diffuse.

GUIDs for other shader parameters (like spec etc..) can be found by looking
at the ui mapping lines in material-phong.spdl.

-Nicolas



On Fri, Jul 26, 2013 at 9:13 AM, Vincent Ullmann 
vincent.ullm...@googlemail.com wrote:

  Becouse it partly fits on this Topic:

 Does anyone know how to set the Viewport-Mapping in a
 Python-ShaderDefinition?

 In a SPDL-File you can set a it via
 ui mapping

 Is there a similar function for Python?



 Am 26.07.2013 18:08, schrieb Vladimir Jankijevic:

 like this: paramOptions.SetDefaultValue( [0.5, 0.3, 0.2] )


 On Fri, Jul 26, 2013 at 6:05 PM, Stefano Jannuzzo 
 stefano.jannu...@gmail.com wrote:

 Hi folks.
 In a shaderdef define function, I can create a color param and set its
 default value to a mid gray by

  paramOptions = XSIFactory.CreateShaderParamDefOptions();
 paramOptions.SetDefaultValue(0.5);
 params.AddParamDef(color, siShaderDataTypeColor3, paramOptions);

  Any idea how to set each channel independently?
 Thanks. Stefano






Re: How to set the default for a color parameter in a shaderdef?

2013-07-26 Thread Vincent Ullmann

Is this in python? == True

Am 26.07.2013 20:35, schrieb Stefano Jannuzzo:
Thanks Vincent, Vladimir. Is this in python? It still doesn't work in 
jscript.


On Fri, Jul 26, 2013 at 6:08 PM, Vladimir Jankijevic 
vladi...@elefantstudios.ch mailto:vladi...@elefantstudios.ch wrote:


like this: paramOptions.SetDefaultValue( [0.5, 0.3, 0.2] )


On Fri, Jul 26, 2013 at 6:05 PM, Stefano Jannuzzo
stefano.jannu...@gmail.com mailto:stefano.jannu...@gmail.com
wrote:

Hi folks.
In a shaderdef define function, I can create a color param and
set its default value to a mid gray by

paramOptions = XSIFactory.CreateShaderParamDefOptions();
paramOptions.SetDefaultValue(0.5);
params.AddParamDef(color, siShaderDataTypeColor3, paramOptions);

Any idea how to set each channel independently?
Thanks. Stefano







Re: How to set the default for a color parameter in a shaderdef?

2013-07-26 Thread Stefano Jannuzzo
Thanks Vincent, Vladimir. Is this in python? It still doesn't work in
jscript.

On Fri, Jul 26, 2013 at 6:08 PM, Vladimir Jankijevic 
vladi...@elefantstudios.ch wrote:

 like this: paramOptions.SetDefaultValue( [0.5, 0.3, 0.2] )


 On Fri, Jul 26, 2013 at 6:05 PM, Stefano Jannuzzo 
 stefano.jannu...@gmail.com wrote:

 Hi folks.
 In a shaderdef define function, I can create a color param and set its
 default value to a mid gray by

 paramOptions = XSIFactory.CreateShaderParamDefOptions();
 paramOptions.SetDefaultValue(0.5);
 params.AddParamDef(color, siShaderDataTypeColor3, paramOptions);

 Any idea how to set each channel independently?
 Thanks. Stefano