The Maxon SDK Team is currently short staffed due to the winter holidays. No forum support is being provided between 15/12/2025 and 5/1/2026. For details see Maxon SDK 2025 Winter Holidays.
  • GeDialog in a Python Script does not work

    r20 python
    3
    1
    0 Votes
    3 Posts
    773 Views
    fwilleke80F
    Aaah, ok, thanks! I browsed a couple of examples here in the forum, and always saw them return True. Should've known better Cheers, Frank
  • Polygon selection order

    python r20
    2
    0 Votes
    2 Posts
    608 Views
    r_giganteR
    Hi Pim, thanks for reaching us. With regard to your question, I confirm that there's no option to get the order of the selected polygons nor the interaction tag can help in this direction. Best, Riccardo
  • Can't open project file in XCode

    7
    0 Votes
    7 Posts
    1k Views
    R
    I found the culprit. My cmyk.cpp file was inside of a folder. When I got it out and placed it alongside the main.cpp file, the project file created by the Project Tool finally opened in XCode. Now I'm getting other errors, but at least the problem reported in this post is solved.
  • Spline modeling commands via OBJECT_MODIFIER (Python)

    5
    0 Votes
    5 Posts
    1k Views
    merkvilsonM
    @m_adam said in Spline modeling commands via OBJECT_MODIFIER (Python): Maxime Thank you, Maxime for your explicit and informative answer! I'll take a look into it.
  • (Again) adding python external modules

    r20 python
    5
    0 Votes
    5 Posts
    1k Views
    M
    Sorry if I wasn't clear. Cinema 4D Python does not come with setuptools or pip installed you have to do it. My point was, PyCharm automatically do it as long as the defined Project Interpreter is c4dpy. Just a quick overview: In Pycharm go to File -> Setting (CTRL+ALT+S) [image: 1547561831227-01.jpg] Then Project Interpreter [image: 1547561878261-02-resized.jpg] In the top, click on the bolt button and Add [image: 1547561922410-03-resized.jpg] Make sure to rename c4dpy.exe to python.exe (Pycharm do not support something not called python) Then define the interpreter as python.exe (our c4dpy.exe located in our Cinema 4D installation) [image: 1547562066435-04-resized.jpg] Click Ok, Select it in the dropDown list, it should load a bit (installation process for pip and setuptools) Then click apply and pip/setuptools is available. You can also search for any package available from pip which is compatible with our version of Cinema 4D by clicking on the Green addition sign. With regards o your question, yes python installation directory is C:\Program Files\MAXON\CINEMA 4D R20.038\resource\modules\python\libs\python27 but you should never modify these files. And we are not responsible for any issues related to any modification of these files. Cheers, Maxime.
  • CSO from virtual objects

    python
    5
    0 Votes
    5 Posts
    1k Views
    M
    Hey @pyr, the tracer object is inserted, only under the null object, which is stored nowhere. That means at the end of the function, the Python Garbage collect actually free memory and all useless stuff it doesn't need anymore. And since the null which holds everything is stored nowhere else, the null is deleted and all its children even your tracer. That's lead to return a no-valid BaseObject. So the best way is to get a clone (aka object not inside any hierarchy) from a cache of the Tracer. With that's said there is no way to make the Python Generator returning a spline since it's not registered with OBJECT_ISSPLINE flag. So the only way will be to make a plugin. Here the code it's already looking very nice! Nice idea indead! import c4d, os PYOUTLINE_ID = 1000001 #Plugin ID class Ooutline(c4d.plugins.ObjectData): def createOutline(self, spline, invert): bc = c4d.BaseContainer() bc.SetData(c4d.MDATA_SPLINE_OUTLINE, invert) bc.SetData(c4d.MDATA_SPLINE_OUTLINESEPARATE, True) res = c4d.utils.SendModelingCommand(command=c4d.MCOMMAND_SPLINE_CREATEOUTLINE, list=[spline], mode=c4d.MODELINGCOMMANDMODE_ALL, bc=bc) if not res: return False return res[0] def GetContour(self, op, doc, lod, bt): # Get a clone of the spline spline = op[c4d.ID_USERDATA,1].GetClone() # Create a null used to define our hierarchy null = c4d.BaseObject(c4d.Onull) # Execute the CreateOutline Function in the created document. newSpline = self.createOutline(spline, op[c4d.ID_USERDATA,2] * -1) if not newSpline: return # Insert it into the Tracer and set up a hierarchy to get things done newSpline.InsertUnder(null) matrix = c4d.BaseObject(1018545) matrix.InsertUnder(newSpline) matrix[c4d.ID_MG_MOTIONGENERATOR_MODE] = 0 matrix[c4d.MG_SPLINE_MODE] = 1 matrix[c4d.MG_SPLINE_STEP] = op[c4d.ID_USERDATA,3] matrix [c4d.MG_OBJECT_LINK] = newSpline tracer = c4d.BaseObject(1018655) tracer.InsertUnder(matrix) inexclude = c4d.InExcludeData() inexclude.InsertObject(matrix,1) tracer[c4d.MGTRACEROBJECT_OBJECTLIST] = inexclude tracer[c4d.MGTRACEROBJECT_MODE] = 2 tracer[c4d.SPLINEOBJECT_TYPE] = 3 tracer[c4d.SPLINEOBJECT_SUB] = 6 tracer[c4d.SPLINEOBJECT_INTERPOLATION] = 1 # Create a temporary document to compute the cache of the tracer workDoc = c4d.documents.BaseDocument() workDoc.InsertObject(null) workDoc.ExecutePasses(bt, False, False, True, c4d.BUILDFLAGS_EXPORT) # Get the SplineObject from the tracer cache tracerSpline = tracer.GetCache() if not tracerSpline: return outSpline = tracerSpline.GetClone() # Close the spline outSpline[c4d.SPLINEOBJECT_CLOSED] = True return outSpline if __name__ == "__main__": bmp = c4d.bitmaps.BaseBitmap() dir, file = os.path.split(__file__) fn = os.path.join(dir, "res", "icon.tif") bmp.InitWith(fn) result = c4d.plugins.RegisterObjectPlugin( id = PYOUTLINE_ID, str = "Test", g = Ooutline, description = "Ooutline", info = c4d.OBJECT_GENERATOR | c4d.OBJECT_ISSPLINE, icon = None) [image: verycool.gif] Cheers, Maxime.
  • Multi threading in Python - Parallelization

    3
    0 Votes
    3 Posts
    955 Views
    N
    I have a script that takes 5 hours to do something I wouldn't mind it taking 5 hours / 12 Thank you for the information. I'll put it to good use... and let you know when I fail!
  • Check if Cinema window is active

    python windows r20
    3
    0 Votes
    3 Posts
    694 Views
    B
    Ok, that's a shame. Would have been useful. Thanks anyway.
  • Struggling with Python Documentation and pyc4d

    python r20
    3
    0 Votes
    3 Posts
    1k Views
    M
    Hi @sungam, first of all, welcome in the plugincafe community and thanks a lot for your feedback. I know these words will not help you but we are currently working to improve our Python Documentation and examples as well. With that's said, I know documentation should be sufficient, but MAXON offers free support for developers at plugincafe. So please contact us when you are in trouble, don't know where to look at or even get SDK issue. res folder is a specific folder where resources needed for your plugin are stored. (e.g. you develop an ObjectData plugin(a new object, like a cube), this cube get a description (a set of parameters, which make a description of the actual object representation), so you need to define theses descriptions within the res folder. Same thing for string and so on...). Clion is actually a C++ IDE, JetBrains offer Pycharm which is also supported by c4dpy. See C4DPY manual we cover how to setup Pycharm with c4dpy. "EnvironmentError: cannot find pyp file - plugin registration failed". I'm not sure to understand this, this error comes from c4dpy? Is it possible to get your current plugin, at least the code of your pyp file? If you have any questions, please open a new thread, in plugincafe we prefer to have one topic per thread so we can focus only into this specific issue and don't screw conversation, it's also easier for other peoples to find information. Do not hesitate to explain to us your project, so we can guide you (help us, to help you ). If it's something you don't want to disclose you can always reach us at [email protected]. Cheers, Maxime.
  • Use Team Render from command line

    3
    0 Votes
    3 Posts
    883 Views
    C
    Hi @r_gigante Thanks for your quick answer. I saw it just now because I wasn't informed via mail I sent my question to the support center now. I'm not sure if they can answer such technical question, that's why I hoped that a fellow developer might know about it I discovered the command line page already, there is unfortunately no command line parameter to explicitly enable TeamRender. Cheers Christian
  • Recompiling a plugin for R20

    5
    0 Votes
    5 Posts
    1k Views
    R
    Sorry for the lateness in replying to this. I was busy creating lots of python versions of my COFFEE scripts, for R20. I will now try to start porting my C++ plugins to R20. Thank you for all the links.
  • Blocking interaction like a modal dialog

    python r20 windows
    4
    0 Votes
    4 Posts
    978 Views
    B
    Just to follow up, what Maxime suggested worked perfectly. No more cheating, basically just c4d.StopAllThreads() dialogThread.Start() dialogThread.Wait(True)
  • Use maxon::StringDecodings::Utf8()

    c++ r20
    3
    0 Votes
    3 Posts
    669 Views
    O
    @r_gigante Thank you for your help. I used the maxon::String and it works fine.
  • How to get the activated objects in the IN/EXCLUDE GUI?

    r19 python
    9
    1
    0 Votes
    9 Posts
    2k Views
    M
    @mp5gosu, that's true I didn't think about this possibility as well. Just for your information, an IcustomGui can only be done with C++ an implementation example can be found in customdata_customgui.cpp. Cheers, Maxime.
  • UVCOMMAND question?

    python r19
    4
    0 Votes
    4 Posts
    1k Views
    .
    Thank you for the guidance. I'll dig into that info.
  • Dialog Layout to Resource Description

    2
    0 Votes
    2 Posts
    486 Views
    M
    Hi @Ogers, a Dialog Layout can't be included within a Description Resource. With that's said, the only way to use GeDialog, GeUserArea into a Description Resource, is to create a CustomGUI (like the Gradient) then in your Description, you can include this CustomGUI. But CustomGui should not be used for a whole Layout, only part of it. An example of a iCustomGui implementation can be found in customdata_customgui.cpp. If you have any question, please let me know. Cheers, Maxime.
  • MatrixToHPB Negative values

    python r20
    4
    0 Votes
    4 Posts
    1k Views
    r_giganteR
    Hi @owen, thanks for following up. As @m_adam has already pointed out there's actually no difference in the values defininig a matrix representing a rotation on -30, -390, 330 or 690 on a certain axis. The lifesafer in this case is to use the already mentioned GetOptimalAngle which actually provides you with the HPB vector that would minimize the rotation given the previous HPB and the current HPB. For the sake of completeness let's assume that at frame 0 H = 0 whilst at frame 1 H = -5. Running the following code just returns the "expected" HPB vector def main(): # set the lastHPB to the previous frame value (in this case zero) lastHPB = c4d.Vector(0,0,0) # retrieve the current rotation order rotOrder = op.GetRotationOrder() # convert from matrix to HPB representation currentHPB = c4d.utils.MatrixToHPB(op.GetMg(), rotOrder) # get the optimal HPB vector optimalHPB = c4d.utils.GetOptimalAngle(lastHPB, currentHPB, rotOrder) print optimalHPB Now using this strategy and knowing the HPB of a clone at the previous frame, you are able to obtain a meaningful HPB representing of the matrix describing the rotation at the current frame of a certain clone (or object). Best, Riccardo
  • Viewport playback thread

    2
    0 Votes
    2 Posts
    584 Views
    M
    Hi @WickedP, actually all the drawing stuff is done in the main thread. In the next topic, you can find all the information about how the scene playback could be done in python https://developers.maxon.net/forum/topic/10292/13784_playpause-control-via-python/3. If you have any question please let me know, and be more specific about what you try to achieve. Cheers, Maxime.
  • Static Text Font/Size in Description Resource

    3
    1
    0 Votes
    3 Posts
    890 Views
    O
    Hello @m_adam, I wish you and all the members of the forum together with the staff Happy New Year. And thank you for your answer. It helped me a lot.
  • Confusing ToolData content

    python c++ r19 r20
    20
    1 Votes
    20 Posts
    5k Views
    S
    Congrats on the new forum! it is very informative About time