• Get points within a given radius

    Moved Cinema 4D SDK
    4
    0 Votes
    4 Posts
    919 Views
    M
    You may want to consider to use scipy. You have to do indexing once, but can the efficiently iterate over the points within a desired radius with the functions that come with the module.
  • Add tooltip to subcommand

    Cinema 4D SDK python windows r20
    3
    0 Votes
    3 Posts
    762 Views
    B
    Thanks for confirming my suspicion
  • How to deepcopy DescID?

    General Talk
    3
    0 Votes
    3 Posts
    1k Views
    mikeudinM
    @m_adam Thank you!
  • Developing .obj sequence exporter for selected objects

    Cinema 4D SDK python
    12
    0 Votes
    12 Posts
    4k Views
    B
    Probably not that helpful but there is an existing script for the C4D OBJ Sequence Exporter https://richh.co/c4d-native-obj-sequence-export-no-plugins/
  • Export selected objects to separate files

    Moved Cinema 4D SDK
    8
    0 Votes
    8 Posts
    5k Views
    K
    Hi @m_adam, thanks for you correction and advice, it's really usefull for me. I'm learn python just couple month and not sure in my code yet. yeah i'm missed this mistake full_dirpath = normpath(join(dirpath, (doc.GetActiveObjects(0)[0]).GetName() + ".obj")) Thanks one more time, always good to have help and support!
  • Open GeDialog on second screen

    Cinema 4D SDK python windows r20
    3
    0 Votes
    3 Posts
    784 Views
    B
    Ok, thanks!
  • BaseDocument.StartPickSession() Documentation

    Cinema 4D SDK python
    2
    0 Votes
    2 Posts
    738 Views
    M
    Hi, Donovan thanks for reaching us. The mystery variable is actually an int flag to retrieve if the user cancels the PickSession or not. def OnPick(flags, active, multi): if flags & c4d.PICKSESSION_FLAG_CANCELED: print "User cancel" print "active: ", active print "multi: ", multi def main(): doc.StartPickSession(OnPick, multi=True) No there is no way. Actually nothing, it's up to you to detect when the user cancels with PICKSESSION_FLAG_CANCELED and do whatever you want. Cinema 4D handle automatically undo. But you can call BaseDocument.GetSelection before and BaseDocument.SetSelection after if the user cancels the pick session) Finally, note the C++ version offer to adds userdata ( For more information please read the C++ documentation https://developers.maxon.net/docs/cpp/2023_2/struct_pick_session_data_struct.html) If you have any question, please let me know. Cheers, Maxime.
  • Drawing into Rendering

    Cinema 4D SDK r20 python windows
    7
    0 Votes
    7 Posts
    2k Views
    r_giganteR
    Hi @rownn, thanks for having provided further details. Assuming that you're aware of the limitation in terms of appearance that you might face by using the functionalities delivered by GeClipMap, the only way to go to access a bitmap which is supposed to contain a rendering of the scene in Python is to execute the rendering invoking the BaseDocument::RenderDocument() and pass the BaseBitmap you intend to manipulate via the GeClipMap. Best, Riccardo
  • Python missing ObjectColorProperties?

    Cinema 4D SDK r19 r20 python
    3
    0 Votes
    3 Posts
    787 Views
    C4DSC
    @cairyn You are right. I thought having to go over the BaseContainer obtained from the object via GetData(), but didn't see anything in its content related to the displaycolor ... didn't think of just accessing the object's properties directly. I am not that confident with the Python SDK. Thanks for the piece of code.
  • Merging external files into plugins

    Cinema 4D SDK python
    4
    0 Votes
    4 Posts
    855 Views
    M
    Hi Merkvilson, the best way would be in the NodeData.Init method to load the scene with LoadDocument(). This will give you a BaseDocument. Then you can retrieve the LineObject or whatever you need from this document. Then get a Clone of these things and draw it inside your Draw method. Just in case, if you would have to return everything in the GetVirtualObject methods, you would need to insert everything under a null and return this null. And to manually handles/tracks material (this part can become very tedious) If you have any questions, please let me know. Cheers, Maxime.
  • GetClone() with Fields

    Cinema 4D SDK r20 python windows
    4
    3
    0 Votes
    4 Posts
    1k Views
    GianniG
    Just tried now… It seems to work perfectly! Thank you! I don't want to boring you, but, please, don't disable this super feature in python. Instead you could update the documentation specifying well how to use it.
  • Subdialog, title

    General Talk python
    10
    1
    0 Votes
    10 Posts
    3k Views
    Passion3DP
    Thank you Maxime, I'll test all this
  • Spline shape for BaseDraw Handles

    Cinema 4D SDK python
    6
    0 Votes
    6 Posts
    2k Views
    M
    The best way would be to store directly the LineObject in a member variable of your ObjectData class. The alternative way to retrieves a LineObject (which is never visible in the ObjectManager) is to call GetCache() from a Spline Object. But a Spline Object can have multiple LineObject and a SplineObject (like any other objects) does not guarantee that a cache is available at any time. So if there is no cache, the best way would have been to clone the SplineObject to a Temporary document, call ExecutePass from this document in order to build the cache. Then retrieves the cached LineObject. But I think SplineHelp, is the best option you have which works in all case, easy to setup/use, is there any drawback to it? Cheers, Maxime.
  • 3 Votes
    6 Posts
    2k Views
    M
    Wow, very nice! There's a huge progress, it now works pretty fast. Thanks for adding the wishlist items.
  • Python Autocomplete in Script Manger

    Cinema 4D SDK python r20
    4
    0 Votes
    4 Posts
    1k Views
    mikeudinM
    @ipython "c4dpy.exe/app is an executable that runs Cinema 4D in Python command-line mode. It is not only an interpreter, it brings extra features for daily Python development with external code editors/IDEs: auto-completion and debugging."
  • 0 Votes
    2 Posts
    633 Views
    r_giganteR
    Hi Pyr, thanks for reaching us. With regard to the issue you reported, it looks like there's something unexpected happening that instead of returning the computed cache, regenerate and returns a new cache. Although it might occur that switching between documents require the generator to recreate the cache, switching between view definitively it's not supposed to happen. Considering that your information doesn't actually help too much in understanding how you're evaluating cache dirtiness nor what changes are you're checking in the vertexmap, could please post fragments of the code or, alternatively, try to reuse your cache dirtiness mechanism on an "simpler" plugin to see if it works reliably? Looking forward further comments, give best. Riccardo
  • 0 Votes
    3 Posts
    875 Views
    P
    Ok this was defently my fault. It works now. I was using GetVirtualObjects instead of GetContour.
  • Catch InputDialog Cancel?

    Cinema 4D SDK
    3
    0 Votes
    3 Posts
    859 Views
    M
    Hi Donovan, unfortunately, there is no change in this regards. The best way is still to check for an empty return value or either creates your own dialog. I've filled a feature request. Cheers, Maxime.
  • How to set project scale

    General Talk r20 python
    6
    0 Votes
    6 Posts
    3k Views
    r_giganteR
    @Rage if you're looking for a solution where the user is not involved, stick to the first answer where no CallButton() was considered. On the contrary using it will request the user to interact since there are no means to programmatically interact with the UI or scripting users' actions on the UI. Best, Riccardo