Signals for geometry switching

pcicconepciccone Posts: 661

Hi.
I need to be notified whenever a figure with object switching in the scene is triggered to switch the geometry.
I see that when The user switches the geometry, one or more materials are added to the figure. I have connected to the materialListChanged() signal for the shape, but that signal doesn't seem to be triggered when the geometry switching is used.

I need to be alerted when a new materials are introduced into a figure because of geometry switching. Is it possible?

Thank you in advance.

Comments

  • rbtwhizrbtwhiz Posts: 2,178
    edited December 1969

    DzObject::currentShapeSwitched()
    DzObject::materialListChanged()

    -Rob

  • pcicconepciccone Posts: 661
    edited December 1969

    Thank you Rob, I'll try that.

  • pcicconepciccone Posts: 661
    edited December 1969

    The signal currentShapeSwitched() doesn't seem to be triggered when the geometry switching happens.

    I have added the following in a function:

    connect(obj, SIGNAL(currentShapeSwitched()), this, SLOT(shapeSwitchHandler()));

    With this handler:

    void Reality_DS::shapeSwitchHandler() {
    RE_LOG_INFO() << "Shape shifted!";<br /> }

    Where RE_LOG_INFO() is my logging stream and nothing happens when I switch the shape. I have a gatling gun from ShareGC that has several pose presets that switch wheels for legs and so on and then any of those presets is applied no call to the shapeSwitchHandler() function happens.

    Any suggestion will be greatly appreciated.

  • dtammdtamm Posts: 126
    edited February 2015

    Pret-A-3D said:
    The signal currentShapeSwitched() doesn't seem to be triggered when the geometry switching happens.

    I have added the following in a function:

    connect(obj, SIGNAL(currentShapeSwitched()), this, SLOT(shapeSwitchHandler()));

    With this handler:

    void Reality_DS::shapeSwitchHandler() {
    RE_LOG_INFO() << "Shape shifted!";<br />}

    Where RE_LOG_INFO() is my logging stream and nothing happens when I switch the shape. I have a gatling gun from ShareGC that has several pose presets that switch wheels for legs and so on and then any of those presets is applied no call to the shapeSwitchHandler() function happens.

    Any suggestion will be greatly appreciated.

    I am guessing that gatlin gun uses alternate geometry?

    The materialListChanged signal is triggered for alternate geometry, but shape change does not for alternate geometry.

    Looks like you are going to have to connect to all the geomControl's on alternate geometries(a somewhat rare thing). It should look something like the following. I have not check it though.

    
      if( DzLegacyFigure* figure = qobject_cast(node) ){
       DzLegacyAlternateGeometryIterator iter = figure->alternateGeometryIterator();
       while( iter.hasNext() ){
        DzLegacyAlternateGeometry* geom = iter.next();
        connect(geom->getObject()->getGeometryControl(), SIGNAL(currentValueChanged()), yourObject, SLOT(shapeSwitchHandler()));
       }
      }
    
    Post edited by dtamm on
Sign In or Register to comment.