Re: [osg-users] Override override?

2011-05-09 Thread Robert Osfield
Hi Anders,

If you want to protect an child's state from being override from above
you use the PROTECTED mode.

Robert.

On Mon, May 9, 2011 at 3:12 AM, Anders Backman ande...@cs.umu.se wrote:
 Hi.
 Guess I been away from OSG a bit too long.
 I have a pretty simple question.
 Assume I have a renderstate which I set to a group (lets call it PARENT) far
 up in the tree close to the root, this state set some default look, with
 shadows, texture and diffuse color.
 It has on|override|protected to make everything in the scene to get this
 look.
 Now assume I want to read in a file (in this case an obj file) into the same
 tree (child PARENT). The material in the obj file SHOULD now be used. So I
 want to override an overridden material.
 What is the best way of achieving that, assuming I want everything from the
 parent (shadows, lights) to be used, EXCEPT for any material stuff in the
 obj file.
 Do I have to load the file, traverse down until I find a state, see if it
 has a material attribute, set it to on|protected|override?
 Or is there any other way of saying, ok, down to this node, we have been
 using the material set from the root (PARENT), but it will stop here.
 From this node down, anything specified (even without OVERRIDE,PROTECTED),
 will be used.


 Cheers,
 Anders
 --
 __
 Anders Backman, HPC2N
 90187 Umeå University, Sweden
 and...@cs.umu.se http://www.hpc2n.umu.se
 Cell: +46-70-392 64 67

 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Override override?

2011-05-09 Thread Anders Backman
Yes,, which means I have to traverse down and protect any StateSet which I
found in the subgraph...

Ok, thats what I though.

/A

On Mon, May 9, 2011 at 9:31 AM, Robert Osfield robert.osfi...@gmail.comwrote:

 Hi Anders,

 If you want to protect an child's state from being override from above
 you use the PROTECTED mode.

 Robert.

 On Mon, May 9, 2011 at 3:12 AM, Anders Backman ande...@cs.umu.se wrote:
  Hi.
  Guess I been away from OSG a bit too long.
  I have a pretty simple question.
  Assume I have a renderstate which I set to a group (lets call it PARENT)
 far
  up in the tree close to the root, this state set some default look, with
  shadows, texture and diffuse color.
  It has on|override|protected to make everything in the scene to get this
  look.
  Now assume I want to read in a file (in this case an obj file) into the
 same
  tree (child PARENT). The material in the obj file SHOULD now be used. So
 I
  want to override an overridden material.
  What is the best way of achieving that, assuming I want everything from
 the
  parent (shadows, lights) to be used, EXCEPT for any material stuff in the
  obj file.
  Do I have to load the file, traverse down until I find a state, see if it
  has a material attribute, set it to on|protected|override?
  Or is there any other way of saying, ok, down to this node, we have been
  using the material set from the root (PARENT), but it will stop here.
  From this node down, anything specified (even without
 OVERRIDE,PROTECTED),
  will be used.
 
 
  Cheers,
  Anders
  --
  __
  Anders Backman, HPC2N
  90187 Umeå University, Sweden
  and...@cs.umu.se http://www.hpc2n.umu.se
  Cell: +46-70-392 64 67
 
  ___
  osg-users mailing list
  osg-users@lists.openscenegraph.org
 
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
 
 
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org




-- 
__
Anders Backman, HPC2N
90187 Umeå University, Sweden
and...@cs.umu.se http://www.hpc2n.umu.se
Cell: +46-70-392 64 67
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Override override?

2011-05-08 Thread Anders Backman
Hi.
Guess I been away from OSG a bit too long.

I have a pretty simple question.
Assume I have a renderstate which I set to a group (lets call it PARENT) far
up in the tree close to the root, this state set some default look, with
shadows, texture and diffuse color.
It has on|override|protected to make everything in the scene to get this
look.

Now assume I want to read in a file (in this case an obj file) into the same
tree (child PARENT). The material in the obj file SHOULD now be used. So I
want to override an overridden material.

What is the best way of achieving that, assuming I want everything from the
parent (shadows, lights) to be used, EXCEPT for any material stuff in the
obj file.

Do I have to load the file, traverse down until I find a state, see if it
has a material attribute, set it to on|protected|override?

Or is there any other way of saying, ok, down to this node, we have been
using the material set from the root (PARENT), but it will stop here.
From this node down, anything specified (even without OVERRIDE,PROTECTED),
will be used.


Cheers,
Anders

-- 
__
Anders Backman, HPC2N
90187 Umeå University, Sweden
and...@cs.umu.se http://www.hpc2n.umu.se
Cell: +46-70-392 64 67
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org