The viewer didn't draw the node because you set the value to the node mask
to something that also avoids the cull visitor to process (visit) the node?

You can't set it to 0 because you will also achieve this behavior. Take a
look at the method ViewerBase::frame. To render a frame, it does 3
traversals on the scene graph: event traversal, update traversal and
rendering traversal. It uses a different visitor for each traversal. But
each visitor use the same node mask (because it is a node attribute not a
visitor). Each visitor has a mask and it defaults to 0xFFFFFFFF (all ones).
Each node mask defaults to 0xFFFFFFFF. So, for each visitor, the
validnodeMask give a result different to 0. I suppose that what you want to
achieve is to control the update visitor, but let the event and rendering
visitor untouchable. So, you need to define the node masks and the visitor
mask to certain values to achieve this behavior. If you set the node mask to
0, all visitors will ignore the node (not what you want). You need also to
set the visitor mask (using NodeVisitor::setTraversalMask).

   Try these values:

      1) Set the update visitor with the traversal mask to 0x00000001  with
viewer.getUpdateVisitor()->setTraversalMask(0x00000001).

      2) Set the node mask of the node you want not to visit during update
traversal to a value with the last bit set to 0 (0xFFFFFFFE)
myNode->setNodeMask(0xFFFFFFFE).

    Then, the other two visitors will have the default value (0xFFFFFFFF).
The result:

    - Event traversal: traversalMask & nodemask = 0xFFFFFFFF & 0xFFFFFFFE =
0xFFFFFFFE. Not equal to 0, then the node is visited.
    - Update traversal: traversalMask & nodemask = 0x00000001 & 0xFFFFFFFE =
0. Then the node is not visited (the update callback isn't called).
    - Rendering traversal: traversalMask & nodemask = 0xFFFFFFFF &
0xFFFFFFFE = 0xFFFFFFFE. Not equal to 0, then the node is rendered.

   Of course, i'm just guessing about what you have coded. Try this if you
want. I suppose your idea could also work, but the difficulty will be how to
define a new event.

Best regards,
Himar.
2009/10/16 Martin Großer <grosser.mar...@gmx.de>

> Hello,
>
> Paul, when I stop the sim time then stop all animation. Or is it a wrong
> guess?
>
> Himar, I tried to change the NodeMask and the viewer did not draw the node.
> I think all functions were ignored, but I would ignore the update callback
> only.
>
> I have an idea. Can I Copy the update callback to event callback and after
> this I remove the udate callback. Now I can define a "event" to run the
> event callback?
>
> Cheers, Martin
>
> Am 16.10.2009 08:59, schrieb Himar Carmona:
>
>   Hi,
>
>     Specifically, AnimationPathCallback has a setPause method.
>
>     More generally, you can control which nodes OSG updates (i.e. visits
> during an updateTraversal) using node masks. Look at the methods
> osg::NodeVisitor::setTraversalMask and validNodeMask for an explanation
> about how it works. In short, visitors have a bit mask (defaults to
> 0xFFFFFFFF) and nodes have a bit mask (defaults to 0xFFFFFFFF). If the
> bitwise "and" operation between them gives a result other than 0, the node
> will be visited. If the result is 0, the node will not be visited. (Really
> the node wil be visited but the update callback will not be called). Node
> visitors has also a Node mask override that allow you to "override" the node
> mask to force the node to be visited ignoring its mask.
>
>  Hope this helps.
> Himar.
> 2009/10/15 Paul Martz <pma...@skew-matrix.com>
>
>> AnimationPath runs off of sim time, so if you mod your app to not
>> increment sim time, then the animation will not play.
>>
>> Paul Martz
>> Skew Matrix Software LLC
>> _http://www.skew-matrix.com_ <http://www.skew-matrix.com/>
>> +1 303 859 9466
>>
>>
>>
>> Martin Großer wrote:
>>
>>> Hello,
>>>
>>> my short question is. When I have a Node with an UpdateCallback function
>>> (maybe a animation), can I skip this function?
>>> Also my Problem is, I export a graph from 3D Max with an animation. The
>>> animation is in a update callback function like the following lines:
>>>
>>> [...]
>>> MatrixTransform {
>>>    DataVariance DYNAMIC
>>>    name "Kugel01"
>>>    nodeMask 0xff
>>>    cullingActive TRUE
>>>    UpdateCallbacks {
>>>      AnimationPathCallback {
>>>        DataVariance DYNAMIC
>>>        pivotPoint 0 0 0
>>>        timeOffset 0
>>>        timeMultiplier 1.0
>>>        AnimationPath {
>>>          DataVariance DYNAMIC
>>>          LoopMode LOOP
>>>          ControlPoints {
>>> [...]
>>>
>>> But I would not start the animation right at the beginning. I think the
>>> viewer calls the update function (update visitor) every frame. I want to
>>> start manually the animation. There are an easy way?
>>>
>>> Cheers,
>>>
>>> Martin
>>>
>>> _______________________________________________
>>> 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
>>
>
> ------------------------------
>
> _______________________________________________
> osg-users mailing 
> listosg-us...@lists.openscenegraph.orghttp://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
>
>
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to