• BaseContainer bc = NULL;

    c++ r20
    3
    0 Votes
    3 Posts
    612 Views
    R
    Thank you Andres. I'm going with the boolean variable to flag if a BaseContainer contains something or not.
  • Quicktab Radio Buttons

    2
    0 Votes
    2 Posts
    812 Views
    merkvilsonM
    Seems like this is a way to go. LONG TEST_BUTTONS {CUSTOMGUI QUICKTABRADIO; CYCLE{ TEST_1; TEST_2; TEST_3; }FIT_H;} Previously my mistake was that I was writing CUSTOMGUI QUICKTABRADIOBUTTON instead of CUSTOMGUI QUICKTABRADIO
  • Non blocking modal

    c++
    3
    0 Votes
    3 Posts
    772 Views
    rsodreR
    @m_adam I think that will not be possible for what I want to do. I ended up catching BFM_LOSTFOCUS in the dialog, canceling the process.
  • INCLUDE user-defined res files

    python
    3
    0 Votes
    3 Posts
    996 Views
    a_blockA
    Hi, no, you are not! Really there are no stupid questions and please do not delete such posts. Especially not, if you already invested time in posting the correct answer. We'd rather see this as knowledge others might benefit from in the future. Cheers, Andreas
  • Using maxon::BaseList with a TreeView?

    2
    0 Votes
    2 Posts
    601 Views
    M
    Hi @Kuroyume0161, first of all, welcome back in the plugincafe community, I'm glad to see you here! Unfortunately, this is not possible to use directly a BaseList with a TreeView and as you already figured it out, you have to maintain this list yourself. While it's very nice that a TreeView offer this abstraction level, and allows to make a list from any kind of data, it has the overhead to builds this TreeView layer. Cheers, Maxime.
  • Adding icon to submenu

    python windows r20
    7
    1
    0 Votes
    7 Posts
    2k Views
    B
    Thanks, Maxime! I will use that in the meantime. Edit: Why can't I flag your posts as the correct answer? I can only flag my own.
  • getline not working

    6
    0 Votes
    6 Posts
    2k Views
    R
    It is so weird that it worked in versions pre R20. Well, I will have to find a new solution, then.
  • GetCache() bug

    python
    4
    0 Votes
    4 Posts
    1k Views
    M
    Hi @merkvilson, this feedback has been communicated to our development team. Cheers, Maxime.
  • Checkmark in submenu list when using GetSubContainer

    python r20
    4
    2
    0 Votes
    4 Posts
    858 Views
    a_blockA
    Yes, that's appropriate. Thanks
  • Undefined symbols for architecture x86_64

    9
    0 Votes
    9 Posts
    3k Views
    R
    This is really weird but after getting this error (and everything all being Ok), the way that I found to get rid of this error is to delete the xcodeproj, the props, the vcxproj and the vcxproj.filters files from the project folder, leaving just the projectdefinition.txt file there, and running the Project Tool again. Then, opening the newly created xcodeproj file, I no longer get this error and it compiles fine.
  • Use of undeclared identifier 'g_resource'

    8
    0 Votes
    8 Posts
    2k Views
    R
    Good news. And... more good news. The best news are that, after creating a Debug version and running Cinema 4D R20 from XCode, all of a sudden, the plugin started working!!! I then created a simple build (not a Debug one) and it is still working fine The other good news is that I now know how to create a Debug version
  • GeDialog in a Python Script: error without exception set?

    python r20
    6
    0 Votes
    6 Posts
    1k Views
    fwilleke80F
    Hi Maxime, now that's interesting. You code runs perfectly fine. If I copy & paste your dialog code into my script, it still works, though your dialog is seemingly similar to mine. So, I have no idea what fixed it, but it did. Maybe some excess trailing spaces somewhere? Weird... but thank you for doing your magic If I ever find out what was happening here, I'll post here. Cheers, Frank
  • Current document in Team Render

    c++
    3
    0 Votes
    3 Posts
    961 Views
    V
    @r_gigante It was about updating an object during the render process but I used a different aproach just by sending the object's doc to that function so I think it could be solved already.
  • GeDialog in a Python Script does not work

    r20 python
    3
    1
    0 Votes
    3 Posts
    869 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
    646 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
    2k 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
    1k 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!