• Build fails with R23 SDK

    r23 sdk
    3
    0 Votes
    3 Posts
    650 Views
    K
    Thank you for your advice. The build was successful !!
  • Drag and Drop external image in a gui Edit Text box with Python

    5
    0 Votes
    5 Posts
    904 Views
    D
    Great! Cheers!
  • Drag&Drop an image in a gui field

    r20 python
    5
    1
    0 Votes
    5 Posts
    1k Views
    D
    @pim I'm trying to figure out how you did this. Could you please share a sample code of this example? I'm trying to get the full path of an image by dragging it into a edit text field... Cheers
  • UVW coordinates in ShaderData.Output()

    r23 c++ python
    12
    3
    0 Votes
    12 Posts
    2k Views
    ManuelM
    hi, I don't see how we could do it with the Draw Method in a efficient way. Cheers, Manuel
  • How to download a file in R20+

    maxon api r21 s22 r23
    5
    0 Votes
    5 Posts
    549 Views
    ManuelM
    hi, by the way, i forgot to talk about the thread thing. This thread might help And of course our manuals about threading Cheers Manuel
  • Global Matrix - Trying to copy data from Mixamo Control Rig with Python

    13
    0 Votes
    13 Posts
    3k Views
    ferdinandF
    Hi @Leo_Saramago, while I agree that using transforms/matrices is more convenient than vectors for position, scale and rotation, it frankly do not quite get why you cannot use the latter since matrices are exactly the same, just written in a more convenient form. There are however multiple convenience methods attached to BaseDocument, .AnimateObject(), .AutoKey(), .Record() and .RecordKey(), with which you can animate nodes without having to deal with the more atomic animation types directly. I have attached a very simple example at the end for the .Record() method, in the hopes that this reflects what you are trying to do. Cheers, Ferdinand """Little example for one of the animation convenience methods of BaseDocuement. Select an object and run the script, it will create a short animation for it. As discussed in: plugincafe.maxon.net/topic/13228/ """ import c4d import math def main(): """ """ # Get out when there is no object selected. op is predefined as the # primary selected object in a script module. if op is None: raise ValueError("Please select an object.") # Set a frozen rotation for that object. op[c4d.ID_BASEOBJECT_FROZEN_ROTATION] = c4d.Vector(0, 0, math.pi) # Set a frozen translation for that object. op[c4d.ID_BASEOBJECT_FROZEN_POSITION] = c4d.Vector(50., 0, 0) # Take ten steps. for t in range(10): # Create a BaseTime in 1/10th of a second intervals from our step count. bt = c4d.BaseTime(t * .1) # Set the document to that time. doc is like op a predefined script # module attribute, pointing to the currently active document. doc.SetTime(bt) # Set the rotation of our object. rotation = t * .1 * math.pi op[c4d.ID_BASEOBJECT_REL_ROTATION] = c4d.Vector(rotation, 0, 0) # You can also make use of SetMg() here if you want to, this however # will not respect the frozen values, or only in a way that is probably # not what you want. So if you set a frozen offset of (100, 0, 0) # for example and then write an offset of (0, 0, 0) into the object # via SetMg(), the object will then have the relative position of # (-100, 0, 0) in the coordinate manger, because (0, 0, 0) in world # coordinates is (-100, 0, 0) in frozen coordinates. Keyframing with # SetMg() will however work fine. # mg = c4d.utils.MatrixRotZ(rotation) # mg.off = c4d.Vector(t * 10, 0, 0) # op.SetMg(mg) # Record the active object(s) in the document. Additional convenience # methods for animating stuff are BaseDocument.AnimateObject(), # .AutoKey(), and .RecordKey(). Se documentation for details. doc.Record() # Push an update event to Cinema 4D, so that our editor is getting updated. c4d.EventAdd() if __name__=='__main__': main()```
  • Undo Problem For TagData Plugin

    python r23
    4
    1
    0 Votes
    4 Posts
    616 Views
    ManuelM
    hi, @beatgram said in Undo Problem For TagData Plugin: So these bracket notation style is safer than using BaseContainer in any case? this should be exactly the same. Sorry i didn't got time to warp my head around it. Cheers, Manuel
  • SaveDocument Unexpected Behavior in R23

    Moved
    3
    0 Votes
    3 Posts
    513 Views
    K
    @m_magalhaes Thank you so much for the help! The script works fine after adding this line. Cheers, Kon
  • External dependencies question

    python
    3
    0 Votes
    3 Posts
    724 Views
    M
    Hi @mfersaoui there is nothing wrong with the way you are doing, but I would like to point out that the sys.path is a global variable shared over the current python environment. Meaning that 3rd party will be able also to import your own module so it's recommended to have an ambiguous name (e.g. if your module1.py is called util.py) people will be able to do import util and this can be really misleading so it's preferred to have a unique name (maybe you can start with a prefix). Finally, the solution offered by @mp5gosu is the cleanest one as it will create a local import space, so your util.py will only be importable by your own pyp file that actually calls the local import so it's so far the cleanest way as you are not "polluting" the global sys.path. But which one is the best, only you can decide according to what you are aiming to produce. Cheers, Maxime.
  • Grabbing a GeUserArea when using InputEvent

    r23 python windows
    4
    1
    0 Votes
    4 Posts
    511 Views
    ferdinandF
    Hi @blastframe, yes, that would be one, and probably the more modern way to do it. I personally like also an explicit call to the base implementation. I think it is more readable for someone else reading your code. But that is probably a rather subjective choice. So for clarity, I am speaking about something like this: foo = bar * baz return c4d.gui.GeUserArea.InputEvent(self, msg) There is of course the advantage of super taking care of calling the proper implementation(s) for you which is not taken care of by this approach, but you cannot have everything and in this case things are rather unambiguous for us here Cheers, Ferdinand
  • Erratic Keyboard Messages in GeDialog

    python r23 windows
    7
    0 Votes
    7 Posts
    1k Views
    ?
    @mp5gosu Sorry, I missed it! That works! In case other devs have a solution, I'll mark yours as the right answer. Thank you!
  • Animating the Status Spin with Render Progress

    python windows r23
    3
    0 Votes
    3 Posts
    460 Views
    ?
    @ferdinand Thank you, Ferdinand for the thorough answer and ideas for workarounds. I don't quite have my head around how to use threading in Cinema 4D yet but you've inspired me to look into it. Thank you!
  • C4D 23 and Visual Studio Code Problem

    4
    2
    0 Votes
    4 Posts
    939 Views
    ferdinandF
    Hi @PATPAT, you can do it, you just cannot use the dummy package for it, but have to use the c4dpy interpreter instead. Cheers, Ferdinand
  • Write to C4D console in real time

    python
    14
    0 Votes
    14 Posts
    3k Views
    indexofrefractionI
    @ivodow how is your ConsolePrint() different to a simple print() statement? in my test i didn''t get a real time output with ConsolePrint() best, index
  • CUSTOMGUI_FONTCHOOSER Text Disappears

    python windows r23
    5
    0 Votes
    5 Posts
    558 Views
    ferdinandF
    Hi @blastframe, so this is a bug that happens independently of Python. It also not connected to your example using a dangling dialog, but to the fact that it is using a dialog. When you implement some form of NodeData plugin and a FONT resource element in it, this bug won't happen. I have opened a bug report for this. For now you would have to either use my little workaround or move outside of a GeDialog environment an implement the whole plugin as some form of NodeData plugin. If a dialog is of high priority for you, you could also display an instance of that node in a DescriptionCustomGui inside your dialog. Which should work and somewhat be a mix of both options. Cheers, Ferdinand
  • Custom register plugin

    8
    0 Votes
    8 Posts
    2k Views
    M
    @WickedP yes you can assume it. Cinema 4D first loads all dlls, then PluginMessage is forwarded to each dlls.
  • From string to constant to check type

    6
    0 Votes
    6 Posts
    979 Views
    John_DoJ
    Thank you for the explanation @ferdinand. The example makes sense even for a beginner like me, that's great
  • Purely dynamic description for shader?

    r21
    15
    0 Votes
    15 Posts
    3k Views
    ferdinandF
    Hi @Filip, okay, thank you for the clarification. Cheers, Ferdinand
  • Error: Wrong indentation of namespace member

    macos c++ r23
    9
    2
    0 Votes
    9 Posts
    2k Views
    fwilleke80F
    Wow, I never thought of that. Very good to know, thank you for asking! Cheers & have a nice weekend, Frank
  • TEXTURE resource parameter

    c++ r23
    4
    0 Votes
    4 Posts
    696 Views
    rsodreR
    Thanks, seems to be working now, thanks.