Navigation

    • Register
    • Login
    • Search
    • Categories
    1. Home
    2. Tags
    3. python
    Log in to post

    • SOLVED Grabbing a GeUserArea when using InputEvent
      Cinema 4D Development • python microsoft windows r23 • • blastframe  

      4
      0
      Votes
      4
      Posts
      36
      Views

      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
    • R

      UNSOLVED Run plugin every frame
      Cinema 4D Development • python general programming • • RneCGI  

      2
      0
      Votes
      2
      Posts
      28
      Views

      Hi @RneCGI, welcome to the forum and the Cinema 4D community. It is unfortunately not possible to answer your question clearly since you left out the relevant main execution method(s) of your implementation (e.g., ObjectData.GetVirtualObjects, etc.). But you are invoking ObjectData.SetOptimizeCache(True) in your RAARCGEN.__init__() which will tell Cinema to optimize the cache of an object by only invoking the building of the cache when the data container of the node is dirty, i.e., when the user changed a parameter. Leaving out this call or passing False in it will cause Cinema 4D to more frequently try to update the cache the node, or in other words call ObjectData.GetVirtualObjects, .GetContour(), .ModifyObject() or .ModifyParticles() more frequently, depending on the flags with which you registered your plugin. You can read more about cache optimization here. In your RAARCGEN.Message() you have also the expression doc = c4d.documents.GetActiveDocument(), which you should not do, since there is no guarantee that the active document is the document your node is located in, because documents also are executed when they are not the active document (in rendering a document is being cloned for example). So you should use GeListNode.GetDocument() instead - like so doc = node.GetDocument(). Last but not least it seems a bit odd to me that you are using an ObjectData implementation to replicate a tiling camera setup. This should more be the job of a TagData solution. If you are planning on returning a camera object as part of the cache of your node data implementation, I would advise against it. This could technically be done, but it would break with Cinema's design as it would seal of setting that camera as the render camera as something that can only be done by your implementation. Which brings us back to the point that your example does not show or indicate your core logic, which makes it hard to give here good advice. So, if my answer did not bring any clarification for you, I would ask you to provide either a more extensive example or send it to sdk_support(at)maxon.net, in case you are not at liberty to share all of your code. Cheers, Ferdinand
    • SOLVED Undo Problem For TagData Plugin
      Cinema 4D Development • python r23 bug report • • beatgram  

      3
      0
      Votes
      3
      Posts
      34
      Views

      @m_magalhaes Thank you for your checking, Manuel. I didn't think it's a bug! And yep, your workaround with bracket notation works fine. So these bracket notation style is safer than using BaseContainer in any case? Anyway, let us know if you confirm this is a bug.
    • SOLVED Erratic Keyboard Messages in GeDialog
      Cinema 4D Development • python microsoft windows r23 • • blastframe  

      7
      0
      Votes
      7
      Posts
      38
      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!
    • SOLVED Animating the Status Spin with Render Progress
      Cinema 4D Development • python microsoft windows r23 • • blastframe  

      3
      0
      Votes
      3
      Posts
      46
      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!
    • UNSOLVED UVW coordinates in ShaderData.Output()
      Cinema 4D Development • python c++ r23 • • rsodre  

      6
      0
      Votes
      6
      Posts
      49
      Views

      M

      As far as I remember, Viewport drawing is handled in Draw() method.
    • H

      UNSOLVED Dialog Plugin with Progress Bar or SetStatusBar
      Cinema 4D Development • python • • HerrMay  

      5
      0
      Votes
      5
      Posts
      74
      Views

      H

      Hi Manuel, hmm… that’s weird. Tried that code as well but the progress bar is still not showing up. I recorded a small screen capture for you to see what i meant by saying: “…I don’t even get a bar to see…“ Maybe this will make things clearer. Cheers, Sebastian
    • SOLVED CUSTOMGUI_FONTCHOOSER Text Disappears
      Cinema 4D Development • python microsoft windows r23 bug report • • blastframe  

      5
      0
      Votes
      5
      Posts
      56
      Views

      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
    • SOLVED Scaling a GeUserArea in a ScrollGroup
      Cinema 4D Development • python microsoft windows r23 • • blastframe  

      4
      0
      Votes
      4
      Posts
      57
      Views

      @ferdinand You are an absolute genius. Thank you so so much, Ferdinand. Incredible!!
    • M

      UNSOLVED Crash with GeListHead and TreeViewFunctions SetName()
      Cinema 4D Development • python r20 r21 r23 bug report • • mp5gosu  

      2
      0
      Votes
      2
      Posts
      35
      Views

      M

      Hi @mp5gosu unfortunately this is a bug, I'm still digging it so thanks for the report :) I will take you informed if I found a workaround. Cheers, Maxime.
    • SOLVED Polygon Islands Convenience Method?
      Cinema 4D Development • python r23 • • dskeith  

      5
      0
      Votes
      5
      Posts
      55
      Views

      Wow! What an incredible set of answers. You've each addressed a different thing I intended to do with these polygon groups once I had access to them. Thank you @ferdinand @m_adam and @pyr!
    • SOLVED SSL TLSV1_ALERT_PROTOCOL_VERSION Error on Mac
      Cinema 4D Development • python r19 apple macos • • blastframe  

      3
      0
      Votes
      3
      Posts
      21
      Views

      @m_adam Thank you, Maxime! Have a good weekend.
    • SOLVED Handles in R18
      Cinema 4D Development • python classic api r19 microsoft windows • • blastframe  

      3
      0
      Votes
      3
      Posts
      33
      Views

      Thank you for letting me know, @ferdinand !
    • P

      SOLVED How to remove generator childs when converting via "c"
      Cinema 4D Development • python r20 r21 r23 s22 • • pyr  

      6
      0
      Votes
      6
      Posts
      41
      Views

      P

      forget about it. i removed the c4d.OBJECT_INPUT flag during development and forgot to add it back.
    • V

      SOLVED How to know baking is end with BakeTextureTag?
      Cinema 4D Development • python r19 • • velbie  

      6
      0
      Votes
      6
      Posts
      51
      Views

      M

      Hi Unfortunately I didn't found any workaround. I saw you deleted the topic but I restored it since there is still valuable information for the next readers, moreover, I will update the post once the bug will be fixed. Cheers, Maxime
    • S

      SOLVED Querying and Storing Object Information
      Cinema 4D Development • python • • Sturdy_Penguin  

      9
      0
      Votes
      9
      Posts
      97
      Views

      Hi @Sturdy_Penguin , without further questions or feedback, we will consider this thread as solved by Monday and flag it accordingly. Cheers, Ferdinand
    • SOLVED How To Add Undo For Description Added Dynamically
      Cinema 4D Development • python r23 • • beatgram  

      8
      0
      Votes
      8
      Posts
      37
      Views

      @Cairyn Thank you so much for helping me again!
    • M

      OOP class struggles: treeview envoce gui refresh outside class ListView()
      Cinema 4D Development • python r20 r23 application development • • mogh  

      4
      0
      Votes
      4
      Posts
      49
      Views

      M

      thank you for your help, I am trying to understand ... am I right in the assumption that this is not "clean code" in a pythonic sense ? kind regards
    • X

      SOLVED Gets the point weight of the Field object.
      Cinema 4D Development • python r21 r23 module • • x_nerve  

      2
      0
      Votes
      2
      Posts
      33
      Views

      Hi @x_nerve, thank you for reaching out to us. The most straightforward way to sample a FieldObject is FieldObject.Sample; there are also other sample methods attached to the various fields related classes, most notably c4d.FieldList. We have two examples in the Python SDK examples which showcase field sampling, fieldlist_sampling_r20 and fieldobject_sampling_20. You also mention "Is there a way to get the weight of the cube field points?"; you are probably aware of this, but since your phrasing could imply otherwise, it seems noteworthy to point out that fields are not discrete. So in other words, there is no finite amount of points you can exhaustively sample for a field object, since the object is non-discrete. You have to pick a point or a set of points you want to sample for a field object, which can be any point in in the value range c4d.Vector can handle. If there are any questions left, please do not hesitate to ask. Cheers, Ferdinand
    • SOLVED Attribute Manamger Update Delay When Description Added Dynamically
      Cinema 4D Development • python r23 • • beatgram  

      13
      0
      Votes
      13
      Posts
      76
      Views

      @m_adam Thank you for confirming. I already know symbolcache thingy, so it's no problem.