Make a static instance of the SolidShader and set the material pointer in the 
GeoInfo to the address of the instance:

static SolidShader solid_shader(0);
…
…
if (!info->material) info->material = &solid_shader;


If you need them to be Ops that show up as Nodes in the DAG then you'll need to 
create plugin wrappers for them.

-jonathan


On May 23, 2013, at 12:05 AM, Ivan Busquets wrote:

> Hi,
> 
> Does anyone know how (or if it's possible at all) to create an instance of 
> SolidShader or ColoredShader?
> 
> Let's say, in a SourceGeo, I am creating objects and assigning a Cf (color) 
> attribute to them.
> 
> This is all good when showing them as "solid", but I would actually like the 
> default material of the objects to be a "ColoredShader" op instead of a 
> "Black" op if no other material is applied.
> 
> I notice that there's a ColoredShader and a SolidShader class in Material.h, 
> but they both have a node-like constructor, and there's no plugins named 
> ColoredShader or SolidShader that I can see (only a .slo compiled shader)
> 
> Also, I notice that nodes like BlendMat must somehow be using this when 
> setting "surface blend" to "vertex color".
> 
> So, in short, is there any way to make use of those .slo in a custom plugin? 
> Or any other way to instantiate a SolidShader or a ColoredShader op?
> 
> Thanks in advance,
> Ivan
> _______________________________________________
> Nuke-dev mailing list
> [email protected], http://forums.thefoundry.co.uk/
> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev

_______________________________________________
Nuke-dev mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev

Reply via email to