Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Recent
    • Tags
    • Users
    • Login

    Using multiple SendModelingCommand()'s?

    Scheduled Pinned Locked Moved SDK Help
    4 Posts 0 Posters 327 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      Helper
      last edited by

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

      On 13/03/2009 at 18:52, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   10.5 
      Platform:   Windows  ;   
      Language(s) :   C.O.F.F.E.E  ;

      ---------
      Hi wise guys,

      after searching hours for this problem, I couldn't find any solution. Maybe you can help.
      I tried to create a OCube-Object, make it editable and then subdivide it. First two points work fine, but I can't subdivide it with a further SendModelingCommand() in the same routine. The odd thing on this is, that there is no error message, everything seems to work fine.

      > \> RockGenPlugin::Execute(doc) \> { \>         var RockObject = AllocObject(Ocube); \>         var RockPhongTag = AllocTag(TPhong); \>         var bc = new(BaseContainer); \> \>         RockObject->SetName("RockGenObject"); \>         doc->InsertObject(RockObject,NULL,NULL); \>         RockObject->InsertTag(RockPhongTag,NULL); \> \>         RockPhongTag#PHONGTAG_PHONG_ANGLELIMIT = TRUE; \>         RockPhongTag#PHONGTAG_PHONG_ANGLE = PI\*80/180; \>         RockPhongTag#PHONGTAG_PHONG_USEEDGES = TRUE; \> \>         SendModelingCommand(MCOMMAND_MAKEEDITABLE, doc, RockObject, bc, MODIFY_ALL);     // works fine. \> \>         bc->SetData(MDATA_SUBDIVIDE_HYPER, TRUE); \>         bc->SetData(MDATA_SUBDIVIDE_ANGLE, PI); \>         bc->SetData(MDATA_SUBDIVIDE_SUB, 1); \> \>         SendModelingCommand(MCOMMAND_SUBDIVIDE, doc, RockObject, bc, MODIFY_ALL);        // doesn't work, but raises no error. \> \>         DrawViews(DA_FORCEFULLREDRAW); \>         var d = new(RockGenDialog); \>         d->Open(-1,-1); \>         return TRUE; \> } \> \>

      In another routine (e.g. a dialog::command routine) it works...

      And there is another question: Why isn't it possible to run multiple Modeling commands in a queue? Maybe like this:

      > \> SendModelingCommand(MCOMMAND_MAKEEDITABLE|MCOMMAND_SUBDIVIDE|MCOMMAND_MELT, doc, op, bc, MODIFY_ALL); \>

      Would be a nice feature... 😉

      Oh, and please don't bully me for that dirty code, errorcatchers and so on will definitely be added. 😉

      greeting, Robert

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

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

        On 14/03/2009 at 12:22, xxxxxxxx wrote:

        never mind, got it... 🙂

        I just forgot to assign the object to a new variable like this:

        > var dummy = doc->FindObject("RockGenObject");

        But is this the optimal way?

        regards, Robert

        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

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

          On 14/03/2009 at 15:42, xxxxxxxx wrote:

          have you seen this part in the sdk doc

          "If a document is provided, an undo is automatically added. If doc is NULL, no undo is added, so one can collect multiple SendModelingCommand() calls "

          1 Reply Last reply Reply Quote 0
          • H Offline
            Helper
            last edited by

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

            On 14/03/2009 at 17:46, xxxxxxxx wrote:

            Darn, that worked too... Thanks for that... 😉

            1 Reply Last reply Reply Quote 0
            • First post
              Last post