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

    How i get the add point tool working?

    Scheduled Pinned Locked Moved PYTHON Development
    3 Posts 0 Posters 340 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

      On 12/02/2015 at 10:08, xxxxxxxx wrote:

      Hi i try to add a point to a polygon objects polygon i searched through the sdk and found  _ID_MODELING_POINT_ADD_TOOL.   _I searched for the tooladdpoint.h i the sdk and found it.
      But i dont kow the meaning of the settings that ive found:
      (copy of the tooladdpoint.h)

      #ifndef TOOLADDPOINT_H__
      #define TOOLADDPOINT_H__

      enum
      {
        MDATA_ADDPOINT_EDGE                                = 1100, // REAL
        MDATA_ADDPOINT_CRTL               = 1101, //BOOL
        MDATA_ADDPOINT_SHIFT              = 1102, //BOOL
        MDATA_ADDPOINT_SPLINE             = 1103,//BOOL
        MDATA_ADDPOINT_OBJINDEX           = 1104,//LONG
        MDATA_ADDPOINT_POINT              = 1105,//VECTOR
        MDATA_ADDPOINT_TVAL               = 1106, //REAL
        MDATA_ADDPOINT_SNUM               = 1107, //LONG
        MDATA_ADDPOINT_POINTMODE          = 1108,//LONG
        MDATA_ADDPOINT_ELEMENTINDEX       = 1109, //LONG
        MDATA_ADDPOINT_EDGEPOINTF         = 1110, //LONG
        MDATA_ADDPOINT_EDGEPOINT1         = 1111, //LONG
        MDATA_ADDPOINT_EDGEPOINT2         = 1112, //LONG
        MDATA_ADDPOINT_POSITIONX                    = 1113,
        MDATA_ADDPOINT_POSITIONY                    = 1114,
        MDATA_ADDPOINT_POSITIONZ                    = 1115,
        MDATA_ADDPOINT_TRI                                = 1116, //Bool
        MDATA_ADDPOINT_
      };

      #endif // TOOLADDPOINT_H__

      1. need i define all the settings if not which
      2. what does MDATA_ADDPOINT_TVAL,MDATA_ADDPOINT_EDGE , MDATA_ADDPOINT_SNUM     ,MDATA_ADDPOINT_OBJINDEX  and MDATA_ADDPOINT_EDGEPOINTF

      A littel example would be more than great:D
      THX

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

        On 13/02/2015 at 06:46, xxxxxxxx wrote:

        Hello,

        you could edit the points and polygons of an poly object directly. The functions to edit the points are defined in the PointObject class, the functions to edit polygons can be found in the PolygonObject class.

        You can use a tool using SendModelingCommand(). The tool you discovered is the "Create Point" tool. This tool has many different modes (a description can be found in the Cinema 4D documentation). The most simple way to add a point may be to add a point to an edge (and thus to the polygons using that edge). This can be as simple as:

          
          settings = c4d.BaseContainer()                   
          settings[c4d.MDATA_ADDPOINT_ELEMENTINDEX] = 1    
          settings[c4d.MDATA_ADDPOINT_EDGE] = 0.5   
              
          
          utils.SendModelingCommand(command = c4d.ID_MODELING_POINT_ADD_TOOL,  
                                      list = [op],  
                                      bc = settings,  
                                      mode = c4d.MODELINGCOMMANDMODE_EDGESELECTION,  
                                      doc = doc)  
          c4d.EventAdd()  
        

        where MDATA_ADDPOINT_ELEMENTINDEX defines the ID of the edge and MDATA_ADDPOINT_EDGE defines the position of the new point along that edge.

        best wishes,
        Sebastian

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

          On 20/02/2015 at 08:32, xxxxxxxx wrote:

          Hello Caradhras,

          was your question answered?

          Best wishes,
          Sebastian

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