Refreshing the viewport while calculating



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

    On 09/06/2008 at 02:38, xxxxxxxx wrote:

    User Information:
    Cinema 4D Version:   10.5 
    Platform:      
    Language(s) :     C++  ;

    ---------
    Hey

    During my plugin execution I am calculating the vertexpoints for a given heigth point, refining a octahedron (link to image) to a final object (link to image)

    After executing the plugin, the viewport is not beeing refreshed until the calculation has been completed.
    For the next step in my plugin I need a redraw while this mesh is build up. Is this possible ?

    Cheers
    Sascha



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

    On 09/06/2008 at 02:41, xxxxxxxx wrote:

    What kind of plugin did you finally choose, generator. tag etc?

    Usally you have to send MSG_UPDATE message to the object and call the EventAdd() function.

    cheers,
    Matthias



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

    On 09/06/2008 at 02:51, xxxxxxxx wrote:

    Hey Matthias,
    I finally chose a command plugin. Within the execute I am allocating camera, target null object and my polyObject, adding them to the doc and calling several functions creating a height field, adding recursivly the new vertices and building a triangle strip (the polyobject)

    Cheers
    Sascha



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

    On 12/06/2008 at 02:21, xxxxxxxx wrote:

    I have tried a few things with several update messages at serveral position inside my code. I don't recognize a visual update, but a higher calculation time. It seems, that, within a CommanPlugin, an editor view update is not an easy task. I am no pro, but i assume, a CommandPlugin does not use a cache like an ObjectPlugin does? The function GetVirtualObject() is called continously in an ObjectPlugin, but otoh making it difficult to bring more than one object into the document...

    Cheers
    Sascha



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

    On 19/06/2008 at 07:52, xxxxxxxx wrote:

    Well I think, since a CommandPlugin is non-threaded, it seems, my object wouldn't be updatable during the calculation process...



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

    On 23/06/2008 at 02:14, xxxxxxxx wrote:

    It is important that you call DrawViews(). Little example

    > \> Bool MenuTest::Execute(BaseDocument \*doc) \> { \>      StopAllThreads(); \> \>      BaseObject \*op = doc->GetActiveObject(); \>      if(!op) return TRUE; \> \>      Random rnd; \>      rnd.Init(36363); \> \>      while(TRUE) \>      { \>           Vector pos = Vector(rnd.Get11()\*100.0, rnd.Get11()\*100.0, rnd.Get11()\*100.0); \> \>           op->SetPos(pos); \> \>           op->Message(MSG_UPDATE); \>           EventAdd(); \>           DrawViews(DA_NO_THREAD|DA_FORCEFULLREDRAW); \>      } \> \>      return TRUE; \> } \>

    cheers,
    Matthias



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

    On 23/06/2008 at 07:51, xxxxxxxx wrote:

    Hey Matthias,

    Thanks for this hint.

    HOLY MOTHER MARY GOD ! Is works in some way... but it runs soooooooo damn slow... Its better not to draw every polygon connected ^^

    [Edit]
    Yeah, every 100th or every 150th polygon is good deal

    Cheers
    Sascha


Log in to reply