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

    Multiple sendmodeling command in Import

    Scheduled Pinned Locked Moved SDK Help
    2 Posts 0 Posters 217 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 02/09/2009 at 13:33, xxxxxxxx wrote:

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

      ---------
      Hello

      I write import plugin with polygon optimalization.
      If use MCOMMAND_OPTIMIZE and MCOMMAND_UNTRIANGULATE commands, sometimes get error messages

      Original Point Number: & Polygon Number: 12141 & 3548
      Optimized Polygon Number -> 3546
      Modeling Kernel Error: Failed
      Modeling Kernel Error: Failed
      Modeling Kernel Error: Invalid Kernel State

      Untriangulated Polygon Number - > 3546

      Whatever I tried to have the error message remains. Here is the code.

      > // ----------------------------------------------------------------------------- \> // Create polygon \> // ----------------------------------------------------------------------------- \> [lots of code] \>           // add polygon to the document // \>                doc->InsertObject(op,cobj,NULL); \>                op->Message(MSG_UPDATE); \> \>           //poligon optimize \>                GePrint("Original Point Number: & Polygon Number: " + LongToString(pointCount) + " & " + LongToString(polygonCount)); \>                if (!PolygonOptimize     (doc, bc, op, parameters)) return FALSE; \>                GePrint("Optimized Polygon Number -> "+ LongToString(op->GetPolygonCount())); \> \>           //Untriangulate \>                if (parameters.optimizeuntriang) \>                { \>                     if (!PolygonUntriang     (doc, bc, op, parameters)) return FALSE; \>                     GePrint("Untriangulated Polygon Number -> "+ LongToString(op->GetPolygonCount())); \>                } \> [/lots of code] \>                      \>                      \> // ----------------------------------------------------------------------------- \> // Polygon optimize \> // ----------------------------------------------------------------------------- \> Bool AC4DPOLY::PolygonOptimize     (BaseDocument \*doc, BaseContainer bc, PolygonObject     \*op, ImportParameters parameters) \> { \>      bc.SetBool(MDATA_OPTIMIZE_POINTS,TRUE); \>      bc.SetBool(MDATA_OPTIMIZE_UNUSEDPOINTS,TRUE); \>      if (parameters.optimizemain) \>      { \>           bc.SetBool(MDATA_OPTIMIZE_POLYGONS,parameters.optimizepoly); \>           bc.SetReal(MDATA_OPTIMIZE_TOLERANCE,parameters.optimizepointdistance); \>      } \>      else \>      { \>           bc.SetBool(MDATA_OPTIMIZE_POLYGONS,FALSE); \>           bc.SetReal(MDATA_OPTIMIZE_TOLERANCE,0.0); \>      } \> \>      ModelingCommandData md; \>      md.doc = doc; \>      md.op = op; \>      md.bc = &bc; \> \>      SendModelingCommand(MCOMMAND_OPTIMIZE,md); \> \>      return TRUE; \> } \> \> // ----------------------------------------------------------------------------- \> // Polygon untriangulate \> // ----------------------------------------------------------------------------- \> Bool AC4DPOLY::PolygonUntriang     (BaseDocument \*doc, BaseContainer bc, PolygonObject \*op, ImportParameters parameters) \> { \>      bc.SetBool(MDATA_UNTRIANGULATE_NGONS,parameters.optimizeuntriang_ngon); \>      bc.SetBool(MDATA_UNTRIANGULATE_ANGLE,parameters.optimizeuntriang_ev); \>      bc.SetReal(MDATA_UNTRIANGULATE_ANGLE_RAD,parameters.optimizeuntriang_rad); \> \>      ModelingCommandData md; \>      md.doc = doc; \>      md.op = op; \>      md.bc = &bc; \> \>      SendModelingCommand(MCOMMAND_UNTRIANGULATE,md); \> \>      return TRUE; \> }

      Any help would be greatly appreciated.
      Regard Dinnye

      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 02/09/2009 at 13:58, xxxxxxxx wrote:

        This error occurs if the value MDATA_UNTRIANGULATE_NGONS is TRUE

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