• Mirroring a Pose

    Cinema 4D SDK python
    3
    1
    0 Votes
    3 Posts
    493 Views
    ?
    Thank you for the clarification, @zipit.
  • 0 Votes
    6 Posts
    2k Views
    r_giganteR
    Hi @gheyret, thanks for reaching out us. Although @zipit has already provide an exhaustive answer to the topic (thanks man!) , I warmly suggest to look also to this blog post[URL-REMOVED] from @fwilleke80 and also to have a look at Navigation in Lists and Trees section on the GeListNode Manual. Best, Riccardo [URL-REMOVED] @maxon: This section contained a non-resolving link which has been removed.
  • 0 Votes
    6 Posts
    1k Views
    ?
    @kbar Thank you for your response. That's really helpful, thank you.
  • 0 Votes
    5 Posts
    882 Views
    B
    I'm just going to go ahead and mark this as solved. Either using an empty Basecontainer or the set function solve the problem. Thank you for explaining!
  • How to handle C4D Unicode in Python scripting?

    Cinema 4D SDK r21 python windows
    12
    0 Votes
    12 Posts
    2k Views
    CairynC
    @zipit said in How to handle C4D Unicode in Python scripting?: well, that API object names thing is a flaw of Python 2. So working as expected or not as expected is a bit a question of the point of view. If you got the string passed from any other source the problem would be the same. Right. The main thing is to understand the issue, and then to write the chapter in a way that explains what to watch out for. (I do wonder how third-party modules would do with a name string passed to them from a script that reads them from the API... well, another bridge to cross another day.) Python 3 clearly is superior in that respect, as there is no unicode class and all str objects are unicode (what they appear to be already in C4D, but with matching len, index, and slice capabilities). On a more productive note: I think that focusing in Unicode strings isn't really that important for Python stuff in c4d, since object names should be something you largely ignore as they are a unreliable source of identification and only are rarely important in other contexts. Hmm, I am not sure whether I would agree to that. Good naming is essential to find your way through complex scenes, and a good naming schema can be built in a way that is friendly to string search and comparison criteria, esp. if you can build your own scripts to perform the search and selection. I just point at the _L _R naming schema for joints that is common in C4D's docs. Of course, if your objects are all named Cube, Cube.1, Cube.2, Cube.3, then name-based identification may be unhelpful Anyway, I am not the person to judge that, as I am only teaching Python to interested users. What they do with it is their own decision; I just have to point out the crucial points so they can apply the code to their own concepts.
  • Howto add a Field input to a python plugin

    Cinema 4D SDK python r19 r20 r21
    3
    0 Votes
    3 Posts
    678 Views
    P
    @s_bach said in Howto add a Field input to a python plugin: FIELDLIST works fine - i think i got an strange error before and trying CUSTOMFIELDLIST etc. solved
  • Error after hitting Undo.

    Cinema 4D SDK r20 python
    13
    0 Votes
    13 Posts
    2k Views
    ManuelM
    @m_magalhaes said in Error after hitting Undo.: i just scratch a bit your code, but i've discovered that with the R21, MCOMMAND_SPLIT only return true. I've opened a bug entry for that. this is fixed in R21.1
  • Mirror a matrix over a defined plane.

    General Talk
    7
    0 Votes
    7 Posts
    2k Views
    D
    @zipit Thank you. That'll help me.
  • ObjectData plugin not rendering to picture viewer

    Moved Cinema 4D SDK
    6
    0 Votes
    6 Posts
    1k Views
    S
    Hello, as now said multiple times, GetActiveDocument() must not be used, but GetDocument() instead. What is the point of your In/Exclude list? Are these the objects you "rotate along the timeline"? This is typically not how a ObjectData object works; it generates objects based on its child objects or deforms objects in its hierarchy. It is not supposed to move arbitrary other objects. As mentioned above, a tag plugin may be the better solution. The "look_at_camera" example show such a plugin rotating its host object. best wishes, Sebastian
  • SendModelingCommand Failing

    Cinema 4D SDK python r21
    9
    0 Votes
    9 Posts
    2k Views
    ManuelM
    hello, I forgot to ask, where are you running those commands ? on a script, a dialogbox, a nodedata ? Thanks for your time trying to isolate the problem. Don't hesitate to send us an heavy scene, we can see why the command isn't working. Cheers, Manuel
  • menu.InsData(, 'CMD') does not work on Tags?

    Cinema 4D SDK r21 python
    4
    0 Votes
    4 Posts
    559 Views
    ManuelM
    hello, without more information from your part, i'll close this thread Cheers, Manuel
  • 0 Votes
    6 Posts
    858 Views
    M
    Oh my, this is horrible ... cheers mogh
  • Keyframing a property using python.

    Moved Cinema 4D SDK
    3
    0 Votes
    3 Posts
    889 Views
    M
    Hi Manual, Thanks for your help! Next time I will use the 'ask question' when posting a question. You code does exactly what I need, much appreciated! Cheers, Martijn
  • Updating ObjectData plugin only on timeline change

    Moved Cinema 4D SDK r20 python
    6
    0 Votes
    6 Posts
    1k Views
    G
    Fantastic, Thank you for the suggestions, ObjectDataOptimizeCache(true) does what I need.
  • Retrieve Center Pivot of Three or More Objects?

    Cinema 4D SDK r21 python
    8
    0 Votes
    8 Posts
    947 Views
    B
    @s_bach Thanks for the response! Works as expected. @zipit No worries. Will close this thread. I will probably revive this a year from now (lol). I have a feeling that Matrix will haunt me again in other aspects so this would be a nice exercise if that happens. Thanks again!
  • Retrieve the Bottom Center Pivot of an Object?

    Cinema 4D SDK r21 python
    5
    0 Votes
    5 Posts
    724 Views
    M
    Hi @bentraje beside zipit said which is indeed correct you may found interesting a plugin I made a long time ago when I started python, which has exactly this purpose but also supports specific objects such as sweep, spline and so on. https://github.com/gr4ph0s/graph_bottom_center_axis/blob/master/bottom_axis_center.pyp Cheers, Maxime.
  • 0 Votes
    4 Posts
    832 Views
    B
    Thanks for the input! It's a shame you can't fiddle with the palettes. I think I'll just do it like x-particles and have a command that loads the palette and the user can dock it himself. Not the most elegant, but gets the job done. Cheers
  • Object plugin hangs when IRR is on

    Cinema 4D SDK python r20
    5
    0 Votes
    5 Posts
    700 Views
    ferdinandF
    Hi, reading this thread one question popped into my mind. You wrote: I create two temporary documents with IsolateObjects(), and after getting the required objects created in the new temporary documents, I KillDocument() both at the end. What do you mean by 'get'? If this means just referencing the objects this might explain your problems, depending on what you are doing with the objects. If you pass the object references as part of the results of your GVO and also free the resources of these temporary documents, you are passing objects that might be dead references at the time of rendering, giving an explanation for your problems. Also: When you just remove the resource freeing of your temporary documents, I do not think that they will be freed automatically by Python's garbage collector. The reason is: While the reference count for these document objects (objects referring here to the Python type) is zero after the scope of GVO has closed (making them candidates for collection) the referenced output objects (here referring to the Cinema type) are still alive and they do reference these document objects. Which would cause your temporary document objects to stay in memory. Which would not be too bad, since it would always be just the two documents and not an incrementally increasing amount, a.k.a a memory leak. Long story short: Clone your objects if you want to pass them as the output and flush the documents afterwards to make things easy for Pythons gc (which is one of the main reasons why Python tends to be bloaty/slow). Cheers zipit
  • Changing CUSTOMGUI_RANGE

    General Talk
    5
    0 Votes
    5 Posts
    1k Views
    r_giganteR
    Hi gsmetzer, with regard the use of the range slide in a resource file please have a look at <Cinema 4D folder>/resource/modules/olod.res: the LOD_BAR parameter is a range slider With regard to using the NodeData::GetDDescription() please check: py-dynamic_parameters_object_r18.pyp py-preference_r19.pyp py-spherify_modifier_r13.pyp Best, Riccardo