• 0 Votes
    8 Posts
    1k Views
    D
    Marvelous @Dunhou, thanks yet again!! Here's the final script in case someone else has use for it: from typing import Optional import c4d doc: c4d.documents.BaseDocument # The active document op: Optional[c4d.BaseObject] # The active object, None if unselected def main(): # Retrieves BaseTime of frame 5, 20 start = 0 end = 1 if c4d.CheckIsRunning(c4d.CHECKISRUNNING_ANIMATIONRUNNING) == True: c4d.CallCommand(12412) # Play Forwards # Loops through the frames for frame in range(start, end + 1): # Changes the time of the document doc.SetTime(c4d.BaseTime(frame, doc.GetFps())) # Updates timeline c4d.GeSyncMessage(c4d.EVMSG_TIMECHANGED) # Redraws the viewport and regenerate the cache object c4d.DrawViews(c4d.DRAWFLAGS_ONLY_ACTIVE_VIEW | c4d.DRAWFLAGS_NO_THREAD | c4d.DRAWFLAGS_STATICBREAK) # Pushes an update event to Cinema 4D c4d.EventAdd(c4d.EVENT_ANIMATE) if __name__ == '__main__': main()
  • 0 Votes
    3 Posts
    2k Views
    ThomasBT
    @ferdinand Hello Ferdinand, Thank you very much first of all. yes, you're right, I worked extremely sloppily with the SMC method, of course I'll take the threading into account and also work with a Temp Document. Regarding the problem itself, I can only say that reinstalling CINEMA 4D solved our problem. Cheers
  • 0 Votes
    8 Posts
    2k Views
    F
    Hi @i_mazlov , Thank you for confirming my solution. Best regards, Tomasz
  • Undo method for LayerShaderLayer

    Moved Bugs python 2024 limitation
    11
    0 Votes
    11 Posts
    2k Views
    John_DoJ
    Oof, that's an unfortunate end for me but at least I have a clear explanation. Thanks @ferdinand
  • Python plugin in costum C4D-Layout

    Cinema 4D SDK 2024 python windows
    3
    0 Votes
    3 Posts
    629 Views
    M
    @ferdinand thank you for your welcoming words, for your help and edits. Since I am no trained developer I was simply copy and pasting my first lines of code including the RegisterCommand function from the maxon python example github and thought it would fit my application since I thought the description in the sdk seemedlike a match to me ["Command can be dragged into an icon bar and delivers its own dialogs instead of icons." (- maybe I got that wrong)]. Also scince I have little developing experience the term "smallnode" is nothing I can make sense of and an accurate description seems to be missing. Nevertheless I tried your suggestion and it works like a charm. Thanks a lot Marc
  • How to get screen space

    Cinema 4D SDK 2024 python
    3
    1
    0 Votes
    3 Posts
    639 Views
    chuanzhenC
    @m_adam Thanks!
  • trigger script when viewport camera is moved

    Cinema 4D SDK python 2023
    3
    0 Votes
    3 Posts
    671 Views
    T
    @i_mazlov thanks so much! some super useful insights here. I think I will have eventually to move to C++
  • How it works new CalcGradientPixel?

    Cinema 4D SDK python 2024
    3
    0 Votes
    3 Posts
    763 Views
    lleallooL
    I am kind of surprised there isn't an easier way to sample a Gradient by a normalized 0-1 position Anyway, thanks @mikeudin for the snippet and @m_adam for the fix
  • 0 Votes
    4 Posts
    971 Views
    G
    The API does appear to have movie saving features. https://developers.maxon.net/docs/py/2023_2/modules/c4d.bitmaps/MovieSaver/index.html
  • How to group nodes in a Scaffold using Python

    Cinema 4D SDK 2024 python
    3
    0 Votes
    3 Posts
    702 Views
    D
    Hey @m_adam , Thanks for your help. It works now. However, I'm wondering how I would have known that I needed to set the scaffold ID to the node. The documentation doesn't seem to explicitly mention this step. I might be wrong, but for someone without strong knowledge of the API, I'd never thought that way. I would rather added the selected nodes to a group, as this is what a scaffol is. Does that make sense? As a side note, after adding the nodes to the scaffold group, they appear messy, actually the nodes are nicely arranged inside the group, but the scaffold is overlapping other nodes. This is likely related to the bug we discussed here: https://developers.maxon.net/forum/post/73446. Am I right? Cheers
  • 0 Votes
    6 Posts
    1k Views
    ferdinandF
    Hey @ThomasB, That has nothing to do with the highlighting but with the fact that Maxime used incorrect links. developers.maxon.net/docs/ links will only work from outside of the forum. Inside the forum you currently have to use dvelopers.maxon.net/assets/docs/ as otherwise nodebb is trying to take over the routing. I am working on fixing that issue. I have fixed both links of Maxime. Cheers, Ferdinand
  • 0 Votes
    7 Posts
    1k Views
    M
    Hi sadly no news, except we kind of know the issue, sadly this issue is somehow by design and will require an architectural change. While we still want to fix this issue, everything is about priority and this is not a urgent priority at the moment so I can't tell you when it will be fixed. But it's on our list. Cheers, Maxime.
  • OpenUSD (pxr) library in c4d python

    Cinema 4D SDK python 2024
    17
    0 Votes
    17 Posts
    6k Views
    i_mazlovI
    Hi @llealloo, please excuse the delayed answers. To the best of my knowledge in the near future there're no plans for integrating usd python bindings into c4d python system. By the way, with the 2025.0 release internal usd library was properly updated to OpenUSD 24.08, so we expect the double loading usd issue to be solved under OSX. Cheers, Ilia
  • 0 Votes
    5 Posts
    1k Views
    CJtheTigerC
    Hi @m_adam, thanks a lot, that did the trick. To close this topic off here's a snippet to allow other objects but not the current object to be dropped in there: def Message(self, node: GeListNode, type: int, data: object) -> bool: if type == c4d.MSG_DESCRIPTION_CHECKDRAGANDDROP: relevant_id = c4d.DescID(c4d.YOUR_PARAM) # Use the ID of the parameter of your object that you want to check. current_id: c4d.DescID = data['id'] if relevant_id.IsPartOf(current_id)[0]: dragged_element = data["element"] is_same_object = node == dragged_element data['result'] = not is_same_object return True return True Cheers, Daniel
  • Include same container multiple times in .res

    Cinema 4D SDK 2024 python c++
    2
    0 Votes
    2 Posts
    517 Views
    i_mazlovI
    Hi Daniel, You cannot include multiple containers and keep their IDs different. There's no special arguments for the INCLUDE statement that can optimize this workflow for you. In your case having your own implementation of CYCLE would be the solution you're looking for. Cheers, Ilia
  • 0 Votes
    3 Posts
    792 Views
    D
    Hi Maxime, thank you very much for your answer! I wasn't sure if storing things in the global document BaseContainer was a good approach, but it's working well. Cheers, Daniel
  • Python: Localized Plugin Name

    Cinema 4D SDK 2024 python
    5
    0 Votes
    5 Posts
    964 Views
    M
    Hi you are right, I double checked and my c4d_string.str was like that, sorry I copy-pasted your in my reply without notifying it. // C4D-StringResource // Identifier Text STRINGTABLE { PLuginName "AAAAAA-ROUNDED Tube"; } All the rest is correct in your sentences. Cheers, Maxime.
  • Python Weight Painting Brush Plugin Questions

    Cinema 4D SDK python 2024
    2
    0 Votes
    2 Posts
    496 Views
    M
    Hi @BretBays this is correct, if you want to make a Brush the easiest way is to register a SculptBrushToolData , you can find examples in Python in Github or in C++ in Github. SculptBrushToolData is derived from DescriptionToolData, meaning they can have a description visible in the attribute manager and therefor you can add your own checkbox if needed. Cheers, Maxime.
  • 0 Votes
    2 Posts
    491 Views
    M
    Hi @baca, sadly it is not possible to get the exact same random in Python than the one used internally for this feature. So the only way would be to actually clone some objects an retrieve their position as shown in read_modata_color.py. The previous example retrieve the color and not the position, so instead of retrieving the MODATA_COLOR, use the MODATA_MATRIX. Cheers, Maxime.
  • Python: Detect Plugins

    Cinema 4D SDK 2024 python windows
    12
    0 Votes
    12 Posts
    2k Views
    J
    Thanks for the response. I'll see if this does what I need it to John Thomas