• Dynamics Body Tag & GetVirtualObjects

    Cinema 4D SDK python
    3
    1
    0 Votes
    3 Posts
    699 Views
    ferdinandF
    Hello @mfersaoui, Without any further questions, we will regard this topic as solved and flag it accordingly by Monday, September, the 8th. Thank you for your understanding, Ferdinand
  • How can I get a Layer's objects with Python?

    Moved Cinema 4D SDK
    4
    0 Votes
    4 Posts
    1k Views
    ferdinandF
    Hello @delizade, we will set this topic to 'Solved' when there are no further questions or replies until Monday, November the 22th. Thank you for your understanding, Ferdinand
  • 0 Votes
    7 Posts
    1k Views
    A
    Hi, I stumbled upon the same problem. The script from bonsak didn't solve the problem for me. But thanks to a tip I found a working solution. It is possible to make a parent-child setup. But you have to change the values in the parent settings after creating the child settings. import c4d from c4d import gui import redshift def main(): #Create main render setting rd = c4d.documents.RenderData() rd.SetName('render_group') rd[c4d.RDATA_RENDERENGINE] = redshift.VPrsrenderer rd_red = redshift.FindAddVideoPost(rd, redshift.VPrsrenderer) doc.InsertRenderData(rd) #Create child render setting child_setting = c4d.documents.RenderData() child_setting.SetName('child setting') child_setting[c4d.RDATA_RENDERENGINE] = redshift.VPrsrenderer doc.InsertRenderData(child_setting , rd) redshift.FindAddVideoPost(child_setting, redshift.VPrsrenderer) doc.InsertRenderData(child_setting , rd) #Change main render settings rd[c4d.RDATA_XRES] = 1920.0 rd[c4d.RDATA_YRES] = 1080.0 rd[c4d.RDATA_FRAMERATE] = 25.0 rd[c4d.RDATA_FORMAT] = 1023671 #PNG rd[c4d.RDATA_FORMATDEPTH] = 1 #depth 16bit #Change Redshift post effect rd_red[c4d.REDSHIFT_RENDERER_ENABLE_AUTOMATIC_SAMPLING] = 0 rd_red[c4d.REDSHIFT_RENDERER_UNIFIED_MIN_SAMPLES] = 32 rd_red[c4d.REDSHIFT_RENDERER_UNIFIED_MAX_SAMPLES] = 256 rd_red[c4d.REDSHIFT_RENDERER_MOTION_BLUR_ENABLED] = 1 rd_red[c4d.REDSHIFT_RENDERER_COLOR_MANAGEMENT_OCIO_VIEW] = 'Un-tone-mapped' if __name__=='__main__': main()
  • C4D Freezes after consecutive Import/Export

    Cinema 4D SDK python
    4
    0 Votes
    4 Posts
    944 Views
    ferdinandF
    Hello @orestiskon, without any further questions, we will consider this topic as solved by Tuesday, November the 2nd and flag it accordingly. Thank you for your understanding, Ferdinand
  • How to Access the Values of GeDialog Gadgets

    Cinema 4D SDK s24 r25 python
    2
    0 Votes
    2 Posts
    455 Views
    ferdinandF
    Hello @mocoloco, thank you for reaching out to us. I have forked your question from How to Highlight a Button since it is a new question which does constitute a new topic. I am also currently on vacation which means that you will have to address the rest of the team to get support in a timely fashion (addressing just me and hiding your question in an older topic was probably what got your question being overlooked). About your question(s): You can find out more about dialog resources, i.e., defining a dialog in a file and not programmatically, in Resource Files Manual and Dialog Resource. Both manuals are part of our C++ documentation but do translate quite directly to Python since resource files are mostly a language agnostic topic. It also remains unclear to me if you actually want to define a dialog or a node since *"using .RES" does not distinguish the two. In either case the resource snippet I did post in the other thread could be used as a template for both cases. I am also not quite sure how the second part of your question is meant. You usually do react to dialog input events in GeDialog.Command. In a node you would have to indeed listen in NodeData.Message() as pointed out by yourself. In a dialog the value would be then attached to the dialog and in case of a node to the node. I.e., in the case of the muscle object thingy polling the quicktab gadget could look like this: Message(self, node, mid, mdata): """Polls a quicktab gadget for the hypothetical muscle object case. Args: node (c4d.BaseList2D): The node to which the message has been sent. mid (int): The message id. mdata (any): The message data. In case of description messages usually a `dict` in Python. """ # The conditioning to a specific message/event type is optional, but # should be in your case probably MSG_DESCRIPTION_POSTSETPARAMETER. if mid == c4d.MSG_DESCRIPTION_POSTSETPARAMETER: # Unpack from which element the message has been sent. eid = mdata["descid"][0].id # This has been sent by the quicktab gadget. if eid == c4d.ID_CA_MUSCLE_OBJECT_STATE: # Get the node state of the parameter which has that quicktab GUI # and do different things based on the state. state = node[c4d.ID_CA_MUSCLE_OBJECT_STATE] if state == c4d.ID_CA_MUSCLE_OBJECT_STATE_RELAX: # ... elif state == c4d.ID_CA_MUSCLE_OBJECT_STATE_COMPRESSED: # ... # ... return True For a more precise answer you should post code or a more precise description of what you are trying to do. And you should also address the rest of the team since I am still going to be on vacation for a few days. Cheers, Ferdinand
  • How to get Preferences folder path?

    Cinema 4D SDK s22 python
    3
    0 Votes
    3 Posts
    665 Views
    chuanzhenC
    @m_adam Great, thank you!
  • Get identical document as the Render document

    Cinema 4D SDK python
    5
    0 Votes
    5 Posts
    989 Views
    ferdinandF
    Hello @orestiskon, without any further questions, we will consider this topic as solved by Tuesday, November the 2nd and flag it accordingly. Thank you for your understanding, Ferdinand
  • How to import svg in S25 from path

    Moved Cinema 4D SDK python
    3
    0 Votes
    3 Posts
    892 Views
    I
    Thank you so much!
  • 0 Votes
    4 Posts
    917 Views
    H
    Wow, thank you both for such detailed and informative replies! First of all, apologies @ferdinand for the tag issues, I was consulting the guidelines whilst typing my question but managed to miss the OS tag. Not sure if it matters too much for python dev, but I am on a Windows machine. I did however notice that the tag list doesn't seem to be updated to include R25 just yet (the version I'm currently working with), so it may need adding by the team. It doesn't look like I'm able to edit my original post past a certain time, but if you have the ability feel free to update Useful to know about the distinction between CommandData.ExecuteOptionID() and CommandData.ExecuteSubID(). The cogwheel icon present on some of the in-built commands was something that I'd noticed previously and been curious as to the implementation of - assumed it was just some complex code magic that added an additional button to the menu UI, ha! I guess that you're probably right in that I shouldn't try to run before I can walk, and if there's no limit to the amount of plugin IDs permitted (makes sense if there are hundreds of thousands of them going spare! ), then the keep-it-simple approach of registering multiple IDs would probably be best at this stage. For future reference though, if it is functionally the same as registering multiple IDs, do you know of any resources showing the implementation of CommandData.ExecuteSubID(), besides the docs; is this something that could be a candidate for an additional example in the SDK plugins repo? @Cairyn thanks for offering a more general insight into the situational decisions behind why something might be the 'best' choice (or not a choice at all!). I'm a designer first and foremost with an interest in coding, rather than the other way around, so considering the UX of a potential plugin and how it could fit into my own workflow is something I'm keen not to ignore To be a little more specific about how the plugin will function: essentially it will be a set of commands allowing the user to rapidly navigate around the viewport in a way that's a bit more custom than the default 'front, back, left, right, etc' views, as well as the ability to toggle between perspective and parallel views, ideally while keeping the same projection matrix (the hard bit!). My intention is to bind these commands to separate shortcuts so that they're a 'function at your fingertips' Actually I do have some additional questions about the ability to set keyboard shortcuts via a plugin, instead of the command manager, and how Cinema then deals with shortcut conflicts, but I think that's one for another thread! Definitely going to refer back to these suggestions as I continue my learning journey. Thank you both again!
  • Python "undo" changes the original selection order

    Moved Bugs python
    6
    0 Votes
    6 Posts
    2k Views
    ManuelM
    yes exact, it's a bug not an error from your implementation.
  • How to Register "Hot key" plugin in python?

    Cinema 4D SDK python r23
    5
    2
    0 Votes
    5 Posts
    1k Views
    gheyretG
    Hi @ferdinand , Thank you very much for your detailed reply. I think it is very helpful to me. Cheers!
  • How to check if document is rendering?

    Cinema 4D SDK python
    6
    0 Votes
    6 Posts
    1k Views
    P
    Hey sorry for gravedigging. i have the problem that my tag plugin recognises the difference between rendering and not rendering. unfortunately it also always changes the state in the doc itself and not only in the doc that is rendered [image: 1720870787719-6484d884-61c7-454c-a256-0f1167238772-grafik.png]
  • 0 Votes
    3 Posts
    477 Views
    D
    Hello Maxime, first of all, thanks for the quick response. You gave me a great clue with the compiled dll version. C4D R23 is compatible with scipy 1.4.0 so the solution was to downgrade it. Thanks again, Daniel
  • 1 Votes
    3 Posts
    460 Views
    ferdinandF
    Hello @SteveJLV, the example has been fixed and both computations now will reflect the correct result. The fixed example will be included with an upcoming release of the Python SDK documentation. Cheers, Ferdinand
  • c4d.BFH_LEFT is not work in menu line?

    Cinema 4D SDK s24 python
    3
    1
    0 Votes
    3 Posts
    347 Views
    gheyretG
    @ferdinand Thanks to your replay, Some of the features I wanted seemed to be addressed in the R25! Let's rock and roll for R25! Cheers!
  • Detect unicode character keypress in a Python script

    General Talk
    6
    0 Votes
    6 Posts
    1k Views
    R
    Ah yes thank you so much!
  • ScrollGroupBegin() is not work in GeUserArea()

    Cinema 4D SDK python s24
    7
    0 Votes
    7 Posts
    903 Views
    gheyretG
    @ferdinand I will handle it. Thanks for your help! Cheers~
  • Enabling Team Render in Render Queue

    Cinema 4D SDK s24 python
    4
    1
    0 Votes
    4 Posts
    863 Views
    CairynC
    (Yes, I notice that the thread has been closed, and marked as solved, and I probably shouldn't barge in, but it seems the original script error has never been addressed, so I must mansplain because that's the obnoxious guy I am.) Two points: The error in the script above is that the index used in SetUseNet is wrong. The indices in the BatchRender element list begin at 0, so the first valid index is 0, and the last is GetElementCount()-1. dBatchCount starts as GetElementCount(), which is fine as counter, but as an index, it is the first unused index. Then this counter is increased += 1, so now it is the second unused index after the list. When AddFile is called with that index, it simply adds the file as last element because it cannot leave empty gaps in the list. It returns True although it didn't use the desired index - it used index-1. Now SetUseNet is called with the same index. The reason it fails is that this index is not the index that AddFile actually used. This index is not even valid. There is no element with that index. So, nothing happens. If you use dBatchCount-1 as index at this point, or simply never increase dBatchCount in the first place, the script works fine. The actual API error is that SetUseNet does not raise an IndexError as the docs claim. (Other methods like GetElementStatus do.) Okay, I go annoy someone else now.
  • Creating "Objects" on Python tag

    Cinema 4D SDK python
    3
    0 Votes
    3 Posts
    573 Views
    orestiskonO
    @m_adam That clears it up, thanks Maxime!
  • 0 Votes
    7 Posts
    759 Views
    ThomasBT
    @m_magalhaes yes thanks that was my idea, too , I created a temporary object, in my case a spline with 0 points and 0 segments and simply exchanged it, thanks.....