• Command line Rendering Takes

    Moved General Talk python
    2
    0 Votes
    2 Posts
    518 Views
    ferdinandF
    Hello @emlcpfx, Welcome to the Plugin Café forum and the Cinema 4D development community, it is great to have you with us! Getting Started Before creating your next postings, we would recommend making yourself accustomed with our Forum and Support Guidelines, as they line out details about the Maxon SDK Group support procedures. Of special importance are: Support Procedures: Scope of Support: Lines out the things we will do and what we will not do. Support Procedures: Confidential Data: Most questions should be accompanied by code but code cannot always be shared publicly. This section explains how to share code confidentially with Maxon. Forum Structure and Features: Lines out how the forum works. Structure of a Question: Lines out how to ask a good technical question. It is not mandatory to follow this exactly, but you follow the idea of keeping things short and mentioning your primary question in a clear manner. About your First Question Since your question is not related to any of the Cinema 4D APIs, it is unfortunately out of scope of support for Plugin Café. I therefore have moved your question to our off-topic forum. The SDK group of Maxon which runs this forum cannot provide an answer in this case, although you might receive a community answer. To receive an answer from Maxon, you should reach out to our support team via a Support Request. When you want to solve the problem programmatically, you are welcome to open a new topic here. This would then however not happen via the commandline app but either the c4dpy or Cinema 4D app. Note that there is no direct solution in our APIs either, likely because Cinema 4D itself does not offer that feature out of the the box. But it should be solvable with ~300 lines of code script. One approach could be to save (temporary) variants of a file for each take in it and launch them then with the render queue as sperate renders. Please also note that we cannot write your script(s) for you, but we are more than happy to help you along the way. So Cheers, Ferdinand
  • TreeView DropDown Menu

    Cinema 4D SDK
    3
    0 Votes
    3 Posts
    901 Views
    ferdinandF
    Hello @simonator420, Thank you for reaching out to us. As announced here, Maxon is currently conducting a company meeting. Please understand that our capability to answer questions is therefore limited at the moment. I am slightly confused about the nature of your questions, especially in the context of the reply from @mogh. TreeViewFunctions.GetDropDownMenu lets you define the content of drop down menus in a TreeView, and the slightly ill named SetDropDownMenu lets you react to an item being selected in such menu. The 'problem' with your code snippet is that you do not differentiate the drop down gadgets which are set in GetDropDownMenu. Like many methods of TreeViewFunctions it is called for each cell in the tree view table, where lColumn denotes the column as defined in your TreeViewCustomGui.SetLayout call, and obj denotes an item in your root, so sort of the row in the tree. lColumn becomes meaningless when your tree view has only one column of type LV_DROPDOWN. How to make sense of obj, depends on the shape of the data you passed as root. When root root is just a list[object], you could for example alternate between even and odd rows like this. def GetDropDownMenu( self, root: list[object], userdata: any, obj: object, lColumn: int, menuInfo: dict): """Simple example for defining the menu content based on the position of #obj in #root. """ index: int = root.index(obj) if index % 2 == 0: menuInfo["menu"][1000] = "Even row first option" menuInfo["menu"][1001] = "Even row second option" else: menuInfo["menu"][1000] = "Odd row first option" menuInfo["menu"][1001] = "Odd row second option" menuInfo["state"] = int(menuInfo["state"]) In practice, the content of a drop down is more likely to be determined based on the fields of obj (e.g., if obj.a == "foo" then Menu1 else Menu2)rather than its relative position in root (be it a list-like or tree-like data structure). Cheers, Ferdinand
  • 0 Votes
    11 Posts
    2k Views
    indexofrefractionI
    @ferdinand first of all, I understand your frustration, we just yesterday talked about the state of the Nodes API and are well aware of its hurdles for anything but super-experts. you can say that aloud! the whole system is very hard to understand. the only thing i got is all we know about traditional materials and even shaders is for the bin. node support evolved over time and most node examples do not work for people still using older c4d versions. also there are misc 3rd-party renderers that use different kinds of nodes / node systems. Drag & drop of attributes to the console doesn't work anymore, as well. the days of easy scripting are gone..
  • Create User Data with Data Type Spline

    Cinema 4D SDK python 2023
    4
    0 Votes
    4 Posts
    928 Views
    ferdinandF
    Hey @pim, It is great to hear that your problem is solved. And to be clear: You can use ChatGPT and Co. to write your code; I would simply ask you to disclose it if you post code (partially) generated by a bot. We understand and agree that chat bots can be a useful tool especially for beginners. But they also have a tendency to write code that is just made up gibberish. When we know that the code has been written by a bot, we can say "that is just noise/garbage". If we do not, we have to point out all problems individually, not only to not offend the author by calling his or her code "garbage", but to also to help the user to understand his or her mistakes. Cheers, Ferdinand
  • Getting the spline from the SplineCustomGui

    Cinema 4D SDK python 2023
    2
    1
    0 Votes
    2 Posts
    519 Views
    ferdinandF
    Hello @pim, Thank you for reaching out to us. As announced here, Maxon is currently conducting a company meeting. Please understand that our capability to answer questions is therefore limited at the moment. The custom GUI for SplineData has its own dedicated GUI type, c4d.gui.SplineCustomGui as pointed out by yourself. So, you must use SplineCustomGui.GetSplineData instead of the generic BaseCustomGui.GetData. Cheers, Ferdinand
  • 0 Votes
    4 Posts
    787 Views
    K
    Hi @m_adam, Sorry for the delay in responding. Yes, the problem has been resolved.
  • wordwrapping difference between r23 and r2023.

    Cinema 4D SDK python r23 2023
    3
    0 Votes
    3 Posts
    806 Views
    D
    hi, thank you - but it has become unnecessary. i did not realize that there is a checkbox in the preferences, called "Script Word Wrap", which was activated while i was working in r23 (probably since the first installation of r23, back in the day), but deactivated (i guess, that's the default setting) in my fresh installation of r2023. it's fine now. i'll mark this one as solved.
  • Need help with Bend-Deformer in Object-Plugin

    Moved Bugs r23 2023 python windows
    6
    0 Votes
    6 Posts
    2k Views
    M
    Hello @ThomasB, without further questions or postings, we will consider this topic as solved by Monday 05/06/2023 and flag it accordingly. Thank you for your understanding, Maxime.
  • how to close c4dpy inside a script?

    Cinema 4D SDK python
    3
    0 Votes
    3 Posts
    722 Views
    M
    Hello @JACK0319, without further questions or postings, we will consider this topic as solved by Monday 05/06/2023 and flag it accordingly. Thank you for your understanding, Maxime.
  • set only the value of a dialog gadget

    Cinema 4D SDK python
    6
    0 Votes
    6 Posts
    1k Views
    D
    huge thanks again @m_adam! the trick with storing the data in a dictionary was super helpful. now i can jump between documents and the dialog updates properly. cheers, sebastian
  • 0 Votes
    3 Posts
    611 Views
    i_mazlovI
    Hello @DjNikMax, Welcome to the Plugin Café forum and the Cinema 4D development community, it is great to have you with us! Getting Started Before creating your next postings, we would recommend making yourself accustomed with our Forum and Support Guidelines, as they line out details about the Maxon SDK Group support procedures. Of special importance are: Support Procedures: Scope of Support: Lines out the things we will do and what we will not do. Support Procedures: Confidential Data: Most questions should be accompanied by code but code cannot always be shared publicly. This section explains how to share code confidentially with Maxon. Forum Structure and Features: Lines out how the forum works. Structure of a Question: Lines out how to ask a good technical question. It is not mandatory to follow this exactly, but you follow the idea of keeping things short and mentioning your primary question in a clear manner. About your First Question The goal you're trying to achieve is a unclear and the proposed steps look redundant. There're a couple of topics I'd like to mention regarding your provided code: Using doc.GetActiveObjects(c4d.GETACTIVEOBJECTFLAGS_CHILDREN) doesn't make any sense in this context, because children are removed when calling "Connect Objects + Delete" command Using c4d.CallCommand(16768) applies this command to the currently selected objects (rather than to the obj on the current loop iteration) If you process objects one-by-one there's no need to group it beforehand, the "Connect Objects + Delete" command can be run directly on the object itself. This would bake rotation and scale into the mesh itself, the position would remain exactly the same as in the original object (without any extra step, no need to instantiate the object and copy it's coordinates back to the baked mesh) If you want to zero-out object position after baking it, you might want to look into freeze transform functionality: c4d.ID_BASEOBJECT_FREEZE_P If you anyways want to deal with transformations, you can check the thread about matrices, mentioned in above. @mogh, thank you for sharing! Let me know if you still have any questions. Cheers, Ilia
  • how to track if the document has changed?

    Cinema 4D SDK python
    4
    1 Votes
    4 Posts
    851 Views
    M
    Hi correct, if you look at my code I do oldDoc = self.activeDoc This means oldDoc will call the activeDoc property getter. And within it I already check for IsAlive and return None if the saved document is not alive. @property def activeDoc(self): doc = getattr(self, '_activeDoc', None) if doc is None: return None if not doc.IsAlive(): return None return doc So for my use case it's fine enough, but you are right, if you store somewhere this oldDoc variable and use it latter then yes you need to check for IsAlive. Cheers, Maxime.
  • description.SetParameter() Question

    Cinema 4D SDK r23 2023 python windows
    11
    0 Votes
    11 Posts
    2k Views
    ThomasBT
    @ferdinand At first I wanted to do it exactly like you recommended, but then I thought why, if you save 36 IDs, it's certainly more memory-efficient. And when you just rename it, you've already learned something again. Actually, I wanted to do it with separate IDs. But then I recognized that I need the exact same 3 parameters, just with other Labels. but since renaming was faster, I decided to do it. It's an update of the previous version of the plugin and it was easiest to just change the labels. I'll think about it, I've got time. Thank you because my English is not always the best, I sometimes find it difficult to read your texts. They are already very extensive in some cases. Good evening!
  • 5 Votes
    3 Posts
    1k Views
    DunhouD
    @JACK0319 Great work ! I have been using ualib for some plugins and worked very well for whatever a beginner or experienced programmer , It's definitely worth trying it [image: 1682952587810-0cf6ade8-8bae-4cd8-96f0-ff3f143c1306-image.png]
  • PYP script doesn't show up in extensions

    Moved Bugs 2023 python
    4
    1
    0 Votes
    4 Posts
    1k Views
    M
    Hi @kiesi, just replying to confirm that what @C4DS is saying is true. If you need to have a plugin installed elsewhere you can add an additional plugin lookup path in the Cinema 4D preference within the Plugin category. Otherwise you can also execute Cinema 4D with the next argument g_additionalModulePath={YourPath} or define g_additionalModulePath as an environment variable to add an additional python lookup path. Cheers, Maxime.
  • Using / copying object properties dialog

    Cinema 4D SDK python 2023
    5
    1
    0 Votes
    5 Posts
    748 Views
    P
    Thanks for the clear answer. I know the difference between description and dialog, but I was hoping I could re-use already defined description in a dialog. But I follow your advise and recreate the settings. Regards, Pim
  • 0 Votes
    3 Posts
    546 Views
    ThomasBT
    @ferdinand thank you very much
  • 0 Votes
    3 Posts
    566 Views
    mikeudinM
    @ferdinand Thank you! I'll check it!
  • Quicktabs in dynamic prefs description

    Cinema 4D SDK
    5
    1
    0 Votes
    5 Posts
    961 Views
    a_blockA
    No worries. Thanks for trying.
  • 0 Votes
    2 Posts
    444 Views
    ferdinandF
    Hello @fkenned1, Welcome to the Plugin Café forum and the Cinema 4D development community, it is great to have you with us! Getting Started Before creating your next postings, we would recommend making yourself accustomed with our Forum and Support Guidelines, as they line out details about the Maxon SDK Group support procedures. Of special importance are: Support Procedures: Scope of Support: Lines out the things we will do and what we will not do. Support Procedures: Confidential Data: Most questions should be accompanied by code but code cannot always be shared publicly. This section explains how to share code confidentially with Maxon. Forum Structure and Features: Lines out how the forum works. Structure of a Question: Lines out how to ask a good technical question. It is not mandatory to follow this exactly, but you follow the idea of keeping things short and mentioning your primary question in a clear manner. About your First Question Your question is a little bit ambiguous, and I am not quite sure what you want to be done here. To get something simple out of the way: Cinema 4D C4DAtom instances, the atomic type all classic API scene elements derive from, have parameters which are indexed by c4d.DescID keys. Cinema 4D does not have properties in its classic API model. I understood what you meant, just as an FYI. This is represented by the methods C4DAtom.GetParameter and .SetParameter. The methods GeListNode.__getitem__ and .__setitem__, i.e., the bracket syntax in Cube[c4d.PRIM_CUBE_SUBY], are just convenience wrappers around the C4DAtom methods. The parameter keys passed to these methods are internally always c4d.DescID, it is only the convenience methods __get/setitem__ which allow you to pass integers instead, e.g., write Cube[c4d.PRIM_CUBE_LEN,c4d.VECTOR_X] or Cube[1100, 1000] (both do the same). I went over the subject of parameter IDs in more detail here. The drag and drop behavior of the Python console is proprietary and not exposed, I also do not quite understand what you want to do with it inside a dialog. If you want to let a user reference an object in a dialog, as for example many objects do in Cinema 4D, you must use a BaseLink parameter. In dialogs you can do this with the CUSTOMGUI_LINKBOX custom gui. I have shown here how to do this. Letting a user reference a parameter in this manner is not possible. You could technically unpack parameter drag data (at least in C++, likely not in Python, have not checked though) to get hold of a dragged BaseList2D and traverse its description (possible in C++ and Python) of a node to figure out to which DescID for example the string "c4d.PRIM_CUBE_LEN, c4d.VECTOR_X" corresponds to. But I do not quite understand the purpose of all this? I am sure there is a less complicated way to achieve what you want to do. I would recommend sharing your code and explaining what you want to achieve on a high level, as the workflow you have in mind is either impossible or at least very labor intensive to implement. Cheers, Ferdinand