Refresh Generator Object



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 08/09/2009 at 08:03, xxxxxxxx wrote:

    User Information:
    Cinema 4D Version:   R11 
    Platform:   Windows  ;   Mac OSX  ; 
    Language(s) :     C++  ;

    ---------
    Hi,

    in the GetVirtualObject-method i create a PolgonObject with some values.
    If i change the values, the viewport doesn't refresh. I have to click somewhere in the interface and then it refreshs.
    I tried it with something like this.

    > \> op->Message(MSG_UPDATE);//and MSG_CHANGE \> EventAdd(EVENT_FORCEREDRAW); \>

    I also tried

    > DrawViews(DA_ONLY_ACTIVE_VIEW|DA_NO_THREAD|DA_NO_ANIMATION); //DrawViews(DA_NO_THREAD|DA_FORCEFULLREDRAW);

    I even overwrote the Message-method of the GeneratorObject without success.

    If i catch the MSG_GETCUSTOMICON-message in the Message-method and call EventAdd(EVENT_FORCEREDRAW); there, it works. But i don't like this dirty hack and i don't want to refresh everytime.

    Anybody an idea what i could try else?

    Thanks!

    cheers,
    Oli



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 08/09/2009 at 08:07, xxxxxxxx wrote:

    It's hard to say, please post some simplified code showing the problem.

    cheers,
    Matthias



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 09/09/2009 at 02:17, xxxxxxxx wrote:

    Ok, here some codesnips

    > \> //GetVirtualObjects \> BaseObject\* AixObject::GetVirtualObjects(PluginObject \*op, HierarchyHelp \*hh){ \>       \>      Bool dirty = op->CheckCache(hh) || op->IsDirty(DIRTY_DATA); \>       \>      if (!dirty){ \>            \>           return op->GetCache(hh); \>      } \>       \>      BaseContainer \*objectData = op->GetDataInstance(); \> \>      BaseObject \*ret = BaseObject::Alloc(Onull); \>       \>      if (!ret){ \> \>           blDelete(ret); \>           return NULL; \>      } \> \>         //...create PolygonObjects or SplineObjects \> \>      Free(polygonObject); \>      Free(splineObject); \>      segmentPoints.Free(); \>       \>      //refresh \>      EventAdd(EVENT_FORCEREDRAW); \>      DrawViews(DA_ONLY_ACTIVE_VIEW|DA_NO_THREAD|DA_NO_ANIMATION); //Tried this too DrawViews(DA_NO_THREAD|DA_FORCEFULLREDRAW); \>       \>      return ret; \> }      \>

    I also tried this.

    > \> //GetVirtualObjects \> BaseObject\* AixObject::GetVirtualObjects(PluginObject \*op, HierarchyHelp \*hh){ \>      //same as above \> \>     //refresh \>     op->Message(MSG_UPDATE); //tried also MSG_CHANGE \> \>    return ret; \> } \> \> //Message \> Bool AixObject::Message(GeListNode \*node, LONG type, void \*t_data){ \>       \>           if (type == MSG_UPDATE) \>      { \>           EventAdd(EVENT_FORCEREDRAW); \>       DrawViews(DA_ONLY_ACTIVE_VIEW|DA_NO_THREAD|DA_NO_ANIMATION);           \>           //DrawViews(DA_NO_THREAD|DA_FORCEFULLREDRAW); \>      } \> \> } \>

    cheers,
    Oli



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 10/09/2009 at 05:37, xxxxxxxx wrote:

    You have to send the MSG_UPDATE message to the polygon object. Also please check the RoundedTube SDK example as this is a parametric generator which creates a polygon object.

    cheers,
    Matthias


Log in to reply