Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware 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
    • Unread
    • Recent
    • Tags
    • Users
    • Login
    1. Maxon Developers Forum
    2. LingZA
    3. Posts
    L
    • Profile
    • Following 1
    • Followers 0
    • Topics 16
    • Posts 25
    • Best 2
    • Controversial 0
    • Groups 0

    Posts made by LingZA

    • RE: Plugin Developer Job opening at Greyscalegorilla

      @kbar
      I am interested in c4d (also cg) plugin development.
      But your requirements are a little bit high for me, especially "Strong proficiency in C++ programming language".
      I can use c++ for programming but not strongly. But I can also make a c++ plugin like this:
      Set View.gif
      A part of my code:
      A part of my code.png

      posted in General Talk
      L
      LingZA
    • Is there any way to get MMB wheel scrolling in viewport?

      Is there any way to stop MMB wheel to zoom the camera then get MMB wheel scrolling in viewport in Description Tool?
      I need to scroll the MMB wheel in the viewport to change my tool's params?
      For example, shift + scroll MMB wheel to increase the value.

      I know how to get MMB wheel scrolling in GeDialog like in asynctest.cpp. But MMB wheel scrolling can not got in MouseInput() in tools (ToolData, DescriptionToolData).

      posted in Cinema 4D SDK c++ python
      L
      LingZA
    • How to dynamically change the "STEP"of "REAL" tool description in c++?

      I wanna dynamically control the "STEP"of a "REAl" description
      parameter for my tool in c++.
      But it is not as easy as the GeDialog in python.

      posted in Cinema 4D SDK c++
      L
      LingZA
    • RE: How to use GetChildren() in c++?

      @ferdinand
      That is great! Thanks!

      posted in Cinema 4D SDK
      L
      LingZA
    • How to use GetChildren() in c++?

      In python, I can op.GetChildren() easily.
      But in c++, GetChildren() is under the
      MAXON_METHOD.
      Because I'm the new to c++, I can not understand the such complex grammar and the usage of this function in c++.
      getchildren.png .
      Please tell me how to get children of an object by using this function in c++.

      posted in Cinema 4D SDK c++
      L
      LingZA
    • How to press the "Apply" button in the DescriptionToolData?

      How to press the "Apply" button in the DescriptionToolData?
      For c++ and python.
      APPLY.png
      For python:

      import c4d
      
      def main() -> None:
      
          c4d.CallCommand(450000263) # C++ SDK - Pick Object Tool
      
          tool = c4d.plugins.FindPlugin(450000263, c4d.PLUGINTYPE_TOOL)
          tool[c4d.MDATA_INTERACTIVE] = True
          c4d.EventAdd()
          if tool is not None:
              c4d.CallButton(tool, c4d.MDATA_APPLY)
              c4d.CallButton(tool, c4d.MDATA_NEWTRANSFORM)
              c4d.EventAdd()
      
          print("execute")
      
      if __name__ == '__main__':
          main()
      

      The python code can excute the settings of the tool. But the "Apply" button isn't pressed and disenabled like the manual pressing action to get the realtime update.

      posted in Cinema 4D SDK c++ python
      L
      LingZA
    • RE: Which are tool plugin flags for Brush Selection tool, even Move tool?

      Thanks, @i_mazlov.
      I know what you say. But that is not my question.
      I don't make the selection tool but the tools maybe like modeling tools.

      PLUGINFLAG_TOOL_EVALUATEHANDLES means that I can see and drag the handles of the coordinate system.

      PLUGINFLAG_TOOL_SINGLECLICK means that I can select the components (points, edges or polygons) of the object or the object itself.

      PLUGINFLAG_TOOL_HIGHLIGHT means that I can highlight the components before I select them to perform a pre-select operation.

      PLUGINFLAG_TOOL_SNAPSETTINGS means that I can run the tool with snapping operations.

      But I don't know the performance of PLUGINFLAG_TOOL_DRAW_MULTIPLANE, PLUGINFLAG_TOOL_EDITSTATES, PLUGINFLAG_TOOL_SWITCHACTION and PLUGINFLAG_TOOL_NO_TOPOLOGY_EDIT.

      But I also want to know the difference between PLUGINFLAG_TOOL_TWEAK and PLUGINFLAG_TOOL_TWEAK_NO_HIGHLIGHT.

      You know,
      before we use move tool to move sometings, we select them first by using the move tool itself.
      before we use modeling tool to make a modeling operation, we select the components by using the modeling tool itself.
      That are selection operations of them.
      I want to simulate the selection operations like them.

      posted in Cinema 4D SDK
      L
      LingZA
    • RE: Which are tool plugin flags for Brush Selection tool, even Move tool?

      tool plugin flags.png

      posted in Cinema 4D SDK
      L
      LingZA
    • Which are tool plugin flags for Brush Selection tool, even Move tool?

      Which are tool plugin flags abount Brush Selection tool, even Move tool?
      I simulate the selection actions about Selection tool, even Move tool in my tool plugins. I want to get clear tool plugin flags about them.

      posted in Cinema 4D SDK 2024 python
      L
      LingZA
    • RE: Undo for InsertUnder() is not right. Why?

      Thanks! Sorry, I am so careless that I ignore the message "Needs to be called before the change.".

      UNDOTYPE_CHANGE:

      Any change to an object, including hierarchy modifications; modification in positioning (object has been moved from A to B), substructures etc. (Needs to be called before the change.)

      posted in Cinema 4D SDK
      L
      LingZA
    • Undo for InsertUnder() is not right. Why?

      Undo for InsertUnder() is not right. Why?
      The code below:
      484e1741-a95f-4822-b48a-fba442a0041c-image.png
      The operations below:
      dfc966ba-afb0-4042-9f8b-7ed824d28062-image.png
      After executing the script:
      90c8752e-afd3-47fe-9efe-35676aeb084c-image.png
      After several undo operations:
      f14cf3ca-9d2a-4310-bb91-2762400c6149-image.png

      The first question is that the undo result is not right.
      The second question is that the undo times are not right.
      There should be one time for undo to get the correct undo result if there is no problem.

      posted in Cinema 4D SDK python
      L
      LingZA
    • Is it possible to change active view?

      Is it possible to change active view via python but "c4d.CallCommand(13640) # Toggle Active View"?

      Because "c4d.CallCommand(13640) # Toggle Active View" is used with a click on the view. I can not use python code to change a certain view to be active.

      I want to change active view via the view ID from "range(doc.GetBaseDrawCount())". But I can not find the relevant APIs.

      I can get the active view from "doc.GetActiveBaseDraw()" but there are no ways to set the active view.

      posted in Cinema 4D SDK python
      L
      LingZA
    • RE: Why does "Symbols Parser" not work?

      Great!!! It runs.
      You are right. Thank you so much!
      I think your answer is worth being written in the API document to make the workflow more clear.

      posted in Cinema 4D SDK
      L
      LingZA
    • Why does "Symbols Parser" not work?

      Why does "Symbols Parser" not work?
      The API document is below.
      https://developers.maxon.net/docs/py/2023_2/manuals/foundation/symbols.html?highlight=c4d_symbols

      I changed "py-fresnel_r13.pyp" in official plugin examples.
      144c0cf7-1530-486d-bdf7-6018f3e37f59-image.png
      38a80529-5925-4d5c-9c15-354e8597065b-image.png
      Finally, I got the issues.
      b1678ae6-5f63-4364-9c42-0c429436d372-image.png

      posted in Cinema 4D SDK python
      L
      LingZA
    • How can I update the deformer when I move the objects in the viewport?

      How can I update the deformer like the "Spline" deformer when I move the objects in the viewport?
      82cff88d-27dd-4ad1-ba58-224cffd0811b-image.png

      e91efb70-3b1f-4a65-a18d-56470e26752e-image.png

      My splines for my deformer plugin are in the "c4d.InExcludeData" like the below.
      96b371cd-d939-4ac8-9767-dc85446b1565-image.png

      I know that the callback function "Draw(self, op, drawpass, bd, bh)" is about the viewport.

      But I don't know how to update the deformer when I move the spline objects or its affected polygon objects in the viewport.

      My updated contents is same as the callback fuction "ModifyObject(self, mod, doc, op, op_mg, mod_mg, lod, flags, thread)".

      posted in Cinema 4D SDK python
      L
      LingZA
    • Is there a "msgId" when I add a child to an object?

      Is there a "msgId" in the function "GetDParameter(self, node, id, flags)" in the class "c4d.plugins.ObjectData" when I add a child to an object?
      The object is a deformer.
      I want to update the function "GetDDescription(self, node, description, flags)" via the function "GetDParameter(self, node, id, flags)" when I add a child to the deformer in the "Object Manager".

      posted in Cinema 4D SDK python
      L
      LingZA
    • Is there a fixed Manager ID like c4d.CONSTANT?

      Does Manager ID change between different c4d versions such as R24, R25 and R26 If Manager ID is based on the options in "Restrict to" in Command Manager.

      744d299e-a173-4c7f-ad8f-34439451cc3e-image.png
      85956201-0980-4ff2-89d6-22ccac5c132b-image.png
      The Manager ID is explained here.
      https://developers.maxon.net/docs/py/2023_2/modules/c4d.gui/index.html#c4d.gui.AddShortcut.

      posted in Cinema 4D SDK python
      L
      LingZA
    • RE: Is there a successful example of c4d.gui.SplineCustomGui?

      @m_adam
      Thanks so much!
      You are a very professional guy!!!

      posted in Cinema 4D SDK
      L
      LingZA
    • Is there a successful example of c4d.gui.SplineCustomGui?

      I need a simple and successful example of c4d.gui.SplineCustomGui which has same params as the picture below.
      d2946599-5784-4459-a8c4-53cf1a7d03f0-image.png

      I have tried directly code below. But it can not have the full control of c4d.gui.SplineCustomGui by bc[c4d.constant], and it is without the gui elements, such as "Point X", "Point Y" and so on.
      class Dialog(c4d.gui.GeDialog):

      def __init__(self):
      
          compoId = 1000
          i = 1
      
          compoId += i
          self.groId_0 = compoId
      
          compoId += i
          self.spliId_0 = compoId
      
      def CreateLayout(self):
          bc = c4d.BaseContainer()  
          # bc[c4d.SPLINECONTROL_GRID_H] = True
          # bc[c4d.SPLINECONTROL_GRID_V] = True
          # bc[c4d.SPLINECONTROL_VALUE_LABELS_H_LEGACY] = True
          # bc[c4d.SPLINECONTROL_VALUE_LABELS_V_LEGACY] = True
          bc[c4d.SPLINECONTROL_X_MIN] = 0
          bc[c4d.SPLINECONTROL_X_MAX] = 1
          # bc[c4d.SPLINECONTROL_X_STEPS] = 0.1
          bc[c4d.SPLINECONTROL_Y_MIN] = 0
          bc[c4d.SPLINECONTROL_Y_MAX] = 1
          # bc[c4d.SPLINECONTROL_Y_STEPS] = 0.1
          # bc[c4d.SPLINECONTROL_PRESET_BTN_LEGACY] = True
          # bc[c4d.SPLINECONTROL_ROUND_SLIDER_LEGACY] = True
          # bc[c4d.SPLINECONTROL_GRIDLINES_H_LEGACY] = 10
          # bc[c4d.SPLINECONTROL_GRIDLINES_V_LEGACY] = 10
          # bc[c4d.SPLINECONTROL_MINSIZE_H] = 0.1
          # bc[c4d.SPLINECONTROL_MINSIZE_V] = 0.1
          # bc[c4d.SPLINECONTROL_X_MIN_TEXT_LEGACY] = "True"
          # bc[c4d.SPLINECONTROL_X_MAX_TEXT_LEGACY] = "True"
          # bc[c4d.SPLINECONTROL_Y_MIN_TEXT_LEGACY] = "True"
          # bc[c4d.SPLINECONTROL_Y_MAX_TEXT_LEGACY] = "True"
          # bc[c4d.SPLINECONTROL_X_TEXT] = "Density"
          # bc[c4d.SPLINECONTROL_Y_TEXT] = "Vertex Weight"
          # bc[c4d.SPLINECONTROL_NEW_NO_HORIZ_LEGACY] = False
          # bc[c4d.SPLINECONTROL_NEW_NO_VERT_LEGACY] = False
          # bc[c4d.SPLINECONTROL_HIDE_GRID_H_LEGACY] = False
          # bc[c4d.SPLINECONTROL_HIDE_GRID_V_LEGACY] = False
          # bc[c4d.SPLINECONTROL_HIDE_PRESET_BTN_LEGACY] = False
          # bc[c4d.SPLINECONTROL_HIDE_ROUND_SLIDER_LEGACY] = False
          # bc[c4d.SPLINECONTROL_HIDE_VALUE_EDIT_H_LEGACY] = False
          # bc[c4d.SPLINECONTROL_HIDE_VALUE_EDIT_V_LEGACY] = False
          # bc[c4d.SPLINECONTROL_HIDE_VALUE_LABELS_H_LEGACY] = False
          # bc[c4d.SPLINECONTROL_HIDE_VALUE_LABELS_V_LEGACY] = False
          # bc[c4d.SPLINECONTROL_ALLOW_HORIZ_SCALE_MOVE] = True
          # bc[c4d.SPLINECONTROL_ALLOW_VERT_SCALE_MOVE] = True
          # bc[c4d.SPLINECONTROL_OPTIMAL] = True
          # bc[c4d.SPLINECONTROL_OPTIMAL_X_MIN] = 0.01
          # bc[c4d.SPLINECONTROL_OPTIMAL_Y_MIN] = 0.01
          # bc[c4d.SPLINECONTROL_OPTIMAL_X_MAX] = 0.01
          # bc[c4d.SPLINECONTROL_OPTIMAL_Y_MAX] = 0.01
          # bc[c4d.SPLINECONTROL_SQUARE] = False
          # bc[c4d.SPLINECONTROL_CUSTOMCOLOR_SET] = True
          # bc[c4d.SPLINECONTROL_CUSTOMCOLOR_COL] = c4d.Vector(1,1,1)
          bc[c4d.SPLINECONTROL_NO_FLOATING_WINDOW] = True
          # bc[c4d.SPLINECONTROL_NO_PRESETS] = False
      
          self.spli = self.AddCustomGui(self.spliId_0, c4d.CUSTOMGUI_SPLINE, "", c4d.BFH_SCALEFIT|c4d.BFV_SCALEFIT, 0, 0, bc)
      
          return True
      

      The second way with description files, I also have tried
      https://developers.maxon.net/forum/topic/13499/splinecustomgui-settings-issue/10?_=1653814204664.
      But I failed.
      If it can have all params like the picture in the second way, I want a successful and simple example including its description files(.res and .h).

      posted in Cinema 4D SDK python
      L
      LingZA