• Get the Next Object of doc.SearchObject() Method?

    Cinema 4D SDK r21 python
    3
    0 Votes
    3 Posts
    701 Views
    B
    @m_adam Ah gotcha. Thanks for the confirmation and the sample code.
  • C4D R21.207 Console don't do anything

    Cinema 4D SDK r21 python
    10
    1
    0 Votes
    10 Posts
    2k Views
    C
    Finally fix it! I reinstalled c4d and everything goes well! Thank you for all you helps!
  • Broken Links in Documentation

    Cinema 4D SDK python sdk
    6
    0 Votes
    6 Posts
    709 Views
    r_giganteR
    Hi guys, we've should have fixed the caching issue in the documentation and we kindly ask, before emptying the cache, to see if the issue persists on your side. In case you still experience the issue, please follow-up with a new post in this thread. Thanks for your help! R
  • Copy Pixels from Active BaseDraw?

    Cinema 4D SDK python
    5
    0 Votes
    5 Posts
    655 Views
    ?
    Hi, Thank you @m_adam and @zipit . I am specifically interested in copying the Viewport pixels for speed. Thank you both for your help.
  • Dynamic HandleInfo.direction

    Cinema 4D SDK python
    6
    1
    0 Votes
    6 Posts
    1k Views
    ferdinandF
    Hello @mfersaoui, without any further questions or replies, we will consider this topic to be solved by Monday and flag it accordingly. Thank you for your understanding, Ferdinand
  • Getting a GadgetID during BFM_INTERACTSTART

    Cinema 4D SDK python
    6
    0 Votes
    6 Posts
    747 Views
    ?
    Thank you both! @zipit & @m_magalhaes
  • Access C4D Objects outside C4D?

    Cinema 4D SDK r21 python
    10
    0 Votes
    10 Posts
    1k Views
    M
    VS Code and Sublime Text are not so well designed and simply spawn a bunch of python interpreters to retrieve the information they need, In contrast, pycharm does use only one and the same python interpreter its spawn. So that's why you got these issues.
  • c4dpy.exe asking for credentials?

    General Talk r21 python
    3
    0 Votes
    3 Posts
    537 Views
    M
    Hi @bentraje as you already figured out in the documentation for R21+ this is necessary because each version (c4dpy, CommandLine, TRS, TRC) now have their own preference folder and doesn't share anymore the one from c4d. Cheers, Maxime.
  • PySide2 for Python 2.7 Windows Version?

    General Talk r21 python
    15
    0 Votes
    15 Posts
    5k Views
    ferdinandF
    Hello @bentraje, no need to be sorry and thanks for closing it Cheers, Ferdinand
  • Adding Keyboard Message: KEY_ENTER & KEY_TAB

    Cinema 4D SDK
    4
    0 Votes
    4 Posts
    627 Views
    ManuelM
    hi, @indexofrefraction, as @blastframe said, let's keep that thread clean and ask your question in another thread, this is working on my system. @blastframe , we will take into consideration your request. Cheers, Manuel
  • Parameter Description Access not working as expected

    Cinema 4D SDK python r20
    14
    0 Votes
    14 Posts
    3k Views
    ferdinandF
    Hello @davidtorno, without any further questions or replies, we will consider this topic to be solved by Monday and flag it accordingly. Thank you for your understanding, Ferdinand
  • Python Tag does not update during rendering

    Cinema 4D SDK python
    9
    0 Votes
    9 Posts
    1k Views
    ManuelM
    hi, we got some information in our documentation. For example you can't add an object in the document from a tag while the generator can return a hierarchy. But you can easily draw information on the viewport with a tag. Cheers, Manuel
  • Disable a Command Plugin

    Cinema 4D SDK python
    11
    0 Votes
    11 Posts
    1k Views
    ?
    @m_magalhaes Thanks Manuel (and @zipit ) for your help. Please let us know about why the Message isn't working.
  • set sculpting layer data from high resolution mesh.

    Cinema 4D SDK
    3
    1
    0 Votes
    3 Posts
    603 Views
    J
    @m_magalhaes Thank you for reply. I am going to use it for this project. Hope it gets fixed soon. Thank you.
  • BaseBitmap.CopyPartTo() with grayscale image

    Cinema 4D SDK python sdk
    5
    0 Votes
    5 Posts
    1k Views
    oli_dO
    Thank you very much Maxime for the reply. I'm looking forward to the r23 and the python 3 with a lot of impatience. Cheers
  • Maximize/Resize "Add Motion Clip" Window

    General Talk
    3
    0 Votes
    3 Posts
    813 Views
    Leo_SaramagoL
    @zipit Thanks!
  • CommandData ExecuteOptionID()

    Cinema 4D SDK python
    9
    0 Votes
    9 Posts
    2k Views
    fwilleke80F
    @m_magalhaes Just chiming in here... any news on those C++ examples? Cheers, Frank
  • id PluginMessage () when the scene loaded

    Cinema 4D SDK python sdk
    12
    0 Votes
    12 Posts
    3k Views
    ManuelM
    hi, sorry I was focused on calling a command and not a script. Even if it's pretty simple, it's not as simple as i expected to run a python script, sorry about that. Be careful that you need to create the script and relaunch c4d to be able to find it by its name. The idea is to retrieve the ID of the script and use callCommand to execute it. (as you can do with any commandData IDs) you can retrieve the ScriptList with GetScriptHead witch return a GeListHead So you can retrieve the first with GetFirst and compare the name. If you find one, you can simply return it's IDs using GetDynamicScriptID and return it. You now just have to use CallCommand with this ID. (be aware that this CallCommand will create an undo step in the undo stack) So your script will be executed when a new document is loaded. #include "maxon/apibase.h" #include "maxon/errorbase.h" #include "maxon/errortypes.h" #include "maxon/file_utilities.h" #include "maxon/application.h" #include "c4d_general.h" #include "c4d_commanddata.h" #include "c4d_baseplugin.h" #include "c4d_scenehookdata.h" #include "c4d_baselist.h" static Int32 GetScriptID(const maxon::String& scriptName) { iferr_scope; // check all script // Retrieves the script head BaseList2D* scriptHead = static_cast<BaseList2D*>(GetScriptHead(0)->GetFirst()); // for all script for (BaseList2D* script = scriptHead; script != nullptr; script = script->GetNext()) { // retrieves the name of the script maxon::String name = script->GetName(); // if the name match the argument, return the id of the script if (name.IsEqual(scriptName)) return GetDynamicScriptID(script); } // return NOTOK if no script founded. return NOTOK; } class pc12835_scenehook : public SceneHookData { public: static NodeData* Alloc() { return NewObjClear(pc12835_scenehook); } Bool Message(GeListNode* node, Int32 type, void* data) override { if (type == MSG_DOCUMENTINFO) { DocumentInfoData* const msg = static_cast<DocumentInfoData*>(data); if (msg == nullptr) return false; // switch message sub-type switch (msg->type) { case MSG_DOCUMENTINFO_TYPE_LOAD: { // define my script name maxon::String scriptName = "myscript"_s; // search the ID of the scrip const Int32 scriptID = GetScriptID(scriptName); // if the script have been founded, execute it. if (scriptID != NOTOK) CallCommand(scriptID); break; } case MSG_DOCUMENTINFO_TYPE_UNDO: case MSG_DOCUMENTINFO_TYPE_REDO: { ApplicationOutput("undo or redo done"_s); break; } } return true; } return SceneHookData::Message(node, type, data); }; }; Of course you need to register your sceneHookData with RegisterSceneHookPlugin Cheers, Manuel
  • Delete Third-Party-Tags?

    Cinema 4D SDK
    7
    0 Votes
    7 Posts
    2k Views
    M
    Hi with the latest update of Cinema 4D (R24 SP1), BasePlugin.GetFilename now also return the file extension in Python. Cheers, Maxime.