• 0 Votes
    4 Posts
    1k Views
    CairynC
    @bentraje Yeah, the second part was meant just in case you have need for a manual process. GetModelingAxis() takes multiselections of elements into account. However, I believe GetModelingAxis() works by selected mode (as you can have different selections for points, polys, and edges in parallel depending on whether the point, poly, edge, or object mode is active. So if you explicitly need the point selection and use the method in a script, you may want to switch to the point mode before using GetModelingAxis(). (Also, the actual modeling axis can be changed by the tools, so caution is in order. Personally, this is the behavior I needed, so I didn't make any big experiments.)
  • Fit image to a plane maintaining the ratio of the image?

    python r20
    2
    3
    0 Votes
    2 Posts
    685 Views
    P
    Together with the help from the c4dlounge.eu forum the issues is solved. The main issue was I did not read the manual good enough. "Note that Size symbolizes the axis size and not the expansion of the object itself. For planar projections, the true dimension is the two/fold of the axis length."
  • Python Tag vs Expresso for Set Driver/Driven Behavior?

    python r20
    6
    0 Votes
    6 Posts
    2k Views
    B
    @Cairyn Interesting "(not just on every frame but far more often)" I guess for now I guess I'll just do it in piecemeal. Other parts in Xpresso nodes and the other python tag. Thanks for the tip on the Python nodes on the Xpresso editor. Haven't tried it. I would go for the pure Xpresso set-up but its a bit finicky to set-up such as identifying where the node sits in the xpresso editor otherwise it sits on top of each other (An automatic layout command would be nice). @m_adam Thanks for the reference!
  • Texture Tag Output

    c++ sdk r20
    15
    0 Votes
    15 Posts
    3k Views
    D
    Hi Riccardo, Thanks for the first response. My bad with not catching that it was a layer shader bug, I figured I had done something wrong with the sampling. I'll start looking into the other projection samplings. Dan
  • Registering tokens in python

    windows python r20
    4
    0 Votes
    4 Posts
    898 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
  • R20 Script State Function

    Moved python r20
    7
    0 Votes
    7 Posts
    2k Views
    M
    Thanks a_block, Sadly I had to disable the state() function because it breaks (delays forever) Material Preview/Shader rendering. This State() function should somehow be isolated if possible ... but i guess this is the limitation of "checking the gui state". kind regards mogh
  • Changing DATETIME_GUI date format

    python r19
    3
    1
    0 Votes
    3 Posts
    794 Views
    A
    @s_bach Hi Sebastian, Thanks for your help! That makes sense! Andre
  • 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

    python r19 r20
    5
    0 Votes
    5 Posts
    980 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
  • Damaged block

    r20 c++ macos
    4
    0 Votes
    4 Posts
    890 Views
    r_giganteR
    Hi Roger, thanks for following up. Although I've run a few tests here trying to mix-up STL data-types and Cinema API ones, I wasn't able to reproduce the issue on Xcode 9.4.1 and Cinema R20.057. That said, where possible, we encourage sticking to Cinema 4D API related data-types in order to grant better performance and superior stability. In your specific case I would go for maxon::BaseArray rather than std::vector and I would have switched from std::vector<std::string> to maxon::BaseArray<maxon::String> Would this be an option? Would you like to share a portion of code to reproduce the issue? Best, Riccardo
  • Universal "Undo" to Rule them All?

    r20 python
    15
    0 Votes
    15 Posts
    5k 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!
  • Triangulate geometry when exporting a fbx

    r20 python
    2
    0 Votes
    2 Posts
    899 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

    r20 python
    2
    0 Votes
    2 Posts
    803 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.
  • Developing .obj sequence exporter for selected objects

    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/
  • Execute a Python Code Within PyCharm that Connects to C4D?

    python r20
    14
    0 Votes
    14 Posts
    5k Views
    B
    Thanks for the confirmation @a_block Will hope for the best in the future regarding sublime Have a great a day ahead!
  • Calling a Tool (Naming Tool) and Modify the Parameters

    r20 python
    7
    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!
  • GeDialog.GetType() Missing Link

    python
    2
    0 Votes
    2 Posts
    575 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
    5 Posts
    1k Views
    B
    Gotcha. Thanks for clarification!
  • Select the Children of a Selected Object. Then, Store it in a List

    r20 python
    4
    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!
  • Drive one parameter with another and vice versa

    python
    3
    0 Votes
    3 Posts
    813 Views
    merkvilsonM
    Thanks, Andreas! This is a really interesting approach.