• 0 Votes
    8 Posts
    3k Views
    M
    @bentraje said in Get World Position of Obj A's position and Set it to Obj B's position: RE: main function Just wondering does it have to be in a main function (like literally the name of the function is main) or just inside the if __name__=='__main__':? Does C4D places special treatment to the word "main"? I was confused at that previously and later realized that if __name__=='__main__': is not specific to C4D but used in python in general in checking if the script is referenced to other script, which I don't do at the moment. So I just skip it. So would this code be just fine? if __name__=='__main__': executeMe() Yes this is correct.
  • Getting a pointer to a UserArea

    Cinema 4D SDK python r19 r20
    5
    0 Votes
    5 Posts
    894 Views
    S
    Hello, I don't have a Cinmea 4D R14 version so I can't test that case. But in R20 some symbols have changed. E.g. c4d.DESCFLAGS_SET_0 was changed to c4d.DESCFLAGS_SET_NONE. Similarly, c4d.USERAREAFLAGS_NONE was c4d.USERAREA_0. best wishes, Sebastian
  • Triangulate geometry when exporting a fbx

    Cinema 4D SDK r20 python
    2
    0 Votes
    2 Posts
    802 Views
    M
    Hi @Rage, I think this question is related to the another topic you posted, so I will not explain again how import/export works in CInema 4D. In your case, you have to use FBXEXPORT_TRIANGULATE and not FBXEXPORT_TRIANGULATE_GEOMETRY. And yes you are right, currently, no symbol is defined for the FBX exporter so you have to use 1026370 directly. Cheers, Maxime.
  • Set options when importing a file

    Cinema 4D SDK r20 python
    2
    0 Votes
    2 Posts
    714 Views
    M
    Hi @rage, you first have to configure the exporter plugin then Load the document/ Merge it. Cinema 4D will automatically use the settings you defined in the plugin. You can find examples of the procedure in our github repository. Finally, symbols for supported exporter/importer are exposed in this page of the Python documentation. Unfortunately, there is no area describing each symbol for each exporter in the python documentation, but you can find them using the search engine in the C++ documentation. (I linked you the C++ symbols of OBJ, import) If you have any questions, please let me know. Cheers, Maxime.
  • Universal "Undo" to Rule them All?

    Cinema 4D SDK r20 python
    15
    0 Votes
    15 Posts
    4k Views
    B
    @Cairyn Thanks again for the detailed explanation. I'll put this to rest. At least for now I know the limitation and the commands to avoid. @s_bach Thanks for the confirmation. Have a great day ahead!
  • Registering tokens in python

    Cinema 4D SDK windows python r20
    4
    0 Votes
    4 Posts
    840 Views
    r_giganteR
    Hi line6dude, thanks for following up. With regard to registering Tokens in c++, given that it's not a complex task, requires at least a minimum background of C++, familiarity with Xcode (or VisualStudio) and understanding of our Cinema 4D tool-chain. If you feel comfortable in becoming familiar with such concepts, please open a new thread to tackle the argument. Best, Riccardo
  • 0 Votes
    7 Posts
    2k Views
    B
    @C4DS Works as expected. Phew! I never knew it is this complicated. Thanks again. Have a great day ahead!
  • 0 Votes
    4 Posts
    2k Views
    B
    @mp5gosu Thanks for the response and for the link regarding recursive and nonrecusive distinction, but I think the recursive version is shorter to write @Cairyn Thanks for the revised script. Works as expected. To be honest, I really do not know Python in C4D per se. I'm just winging it. Hahaha. So, thanks for the explanation!
  • GeDialog.GetType() Missing Link

    Cinema 4D SDK python
    2
    0 Votes
    2 Posts
    503 Views
    M
    Hi, @merkvilson thanks for pointing this function is private and have no use case since its return the type of a c4d.gui.Gadget which is only used internally. Cheers, Maxime.
  • 0 Votes
    9 Posts
    2k Views
    M
    This issue is now fixed in R21. Cheers, Maxime.
  • 0 Votes
    5 Posts
    992 Views
    B
    Gotcha. Thanks for clarification!
  • 3rd party APIs into pyp/pypv file

    Cinema 4D SDK python
    7
    0 Votes
    7 Posts
    4k Views
    M
    Hi see Cinema 4d R23 MacOs Pip Install Broken.
  • 0 Votes
    14 Posts
    4k Views
    B
    Thanks for the confirmation @a_block Will hope for the best in the future regarding sublime Have a great a day ahead!
  • Drive one parameter with another and vice versa

    Cinema 4D SDK python
    3
    0 Votes
    3 Posts
    737 Views
    merkvilsonM
    Thanks, Andreas! This is a really interesting approach.
  • 0 Votes
    3 Posts
    1k Views
    K
    Hi @m_adam Thank you for your reply. It works perfectly!
  • Request UAC from pyp/pypv

    Moved General Talk python
    4
    0 Votes
    4 Posts
    1k Views
    a_blockA
    Hi, no worries, the first line is so big because of a stray "=" on the next line, underlining the first to be interpreted as a heading. I'll move this thread to the General Programming & Plugin Discussions category, because in the end C4D does not provide any means to provoke UAC, nor do we deem it necessary inside our API as it is a pretty system specific thing. Yet, the discussion might lead back to C4D related questions, and then I'll either happily move it back or we'll have a new thread in the Cinema 4D Development category. In general I think, it would probably be better to convince your users to install the plugin into either the plugins folder in the "user folder" or even (assuming R20+) a completely separate directory added to the users prefs. Another thought, while definitely possible with Python, I'd say an update mechanism should change/replace files while the main application is running. After all you can not be completely sure, which files the application decides to lock at certain points off time, in which case your updater would probably run into issues. My recommendation is to rather update by restarting the main app (for C++ it's inevitable anyway). Cheers, Andreas
  • 0 Votes
    4 Posts
    1k Views
    a_blockA
    Hi, I'm sorry for getting back late to you. We have never done this ourselves nor have we heard of anyone. The reasons for the difference between C++ and Python API are probably historic. Also back then we had no generic concept for callbacks in Python. Now, with MAXON API and appearance of Delegates and Observables such things will probably handled much nicer in future. Maybe it were also performance considerations. Many words, for a "I don't know", sorry. In any case we'll forward this a an idea to our development, so it is at least considered for a future release. Cheers, Andreas
  • Cinema 4D R20 and Octane 3.08.5 attribute issue

    Cinema 4D SDK
    11
    0 Votes
    11 Posts
    6k Views
    A
    @a_block Hi Andreas, Thanks for your help and you are never too late! That actually makes more sense. Unfortunately I can't seem to replicate the issue again on my machine, as it seems that it's been working for all my updates. I will have a look on one of my team machines when released and see if that could be the problem. Thank you again!
  • 0 Votes
    12 Posts
    3k Views
    M
    Please do not delete topics once they are resolved, this topic may help other people that have the same issue. Instead, use the Q&A functionality to mark a topic as solved. Cheers, Maxime.
  • c4d.PrefsLib_OpenDialog is not working.

    Cinema 4D SDK python r20
    3
    0 Votes
    3 Posts
    634 Views
    merkvilsonM
    @m_adam Thanks, Maxime! You solved yet another issue.