Navigation

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

    • F

      SOLVED Changing material projection in takes using Python
      Cinema 4D Development • python brainstorming • • Futurium  

      12
      0
      Votes
      12
      Posts
      114
      Views

      F

      Thank you @zipit I adopted your solution into our code and it works exactly as expected. Thank you for your help. Best regards, Tomasz
    • E

      SOLVED BaseLink crash and tracking PolygonObjects/InstanceObjects in cache
      Cinema 4D Development • c++ bug report general programming brainstorming • • ECHekman  

      3
      0
      Votes
      3
      Posts
      48
      Views

      Hi, without further feedback, we will consider this thread as solved by Monday and flag it accordingly. Cheers, Ferdinand
    • SOLVED Matrices / Rotations / Quaternions when transferring data.
      General Programming & Plugin Discussions • python brainstorming • • lasselauch  

      4
      0
      Votes
      4
      Posts
      67
      Views

      Hey guys, just wanted to let you know, that I've cracked the case in the meantime. Here are my findings: def convert_matrix_left_to_right(m): # http://www.techart3d.com/2016/02/convert-left-handed-to-right-handed-coordinates/ # m = op.GetMg() new_m = c4d.Matrix( m.off, m.v1*-1, m.v2, m.v3) return new_m def rotate_y_axis_180(): # Construct your own matrix based on rotation of axis # https://www.mathworks.com/help/phased/ref/roty.html x = c4d.Vector(-1, 0, 0) y = c4d.Vector(0, 1, 0) z = c4d.Vector(0, 0, -1) off = c4d.Vector(0, 0, 0) return c4d.Matrix(off, x, y, z) def GetGlobalRotation(obj): m = obj.GetMg() new_m = rotate_y_axis_180() * convert_matrix_left_to_right(m) return c4d.utils.MatrixToHPB(new_m, order=c4d.ROTATIONORDER_XYZGLOBAL) Indeed you have to convert from a left-handed (c4d) (hpb) to a right-handed (houdini) (xyz) coordinate system... plus I've found that you need to add 180° to the y axis, so I constructed a matrix in rotate_y_axis_180 that I can multiply to my converted matrix. Hope it helps someone... Thank you guys for your input! Have a great weekend and stay safe! Cheers, Lasse
    • N

      SOLVED Get Point Positions of Selected N-Gon or Polygon
      General Programming & Plugin Discussions • python brainstorming • • noseman  

      11
      0
      Votes
      11
      Posts
      346
      Views

      X

      Hi: This is a bit of a hassle, but can still be scripted, who CARES about an extra polygon. import c4d def main(): polygons = op.GetAllPolygons() points = op.GetAllPoints() point = [c4d.Vector(10000, 10000, 10000),c4d.Vector(9999, 10000,10000), c4d.Vector(9999, 10000, 10001),c4d.Vector(10000, 10000, 10001)] point_indexe = [[len(points) + i ,point[i]] for i in range(len(point))] op.ResizeObject(len(points) + len(point),len(polygons) + 1) set_point = [op.SetPoint(k[0], k[1]) for k in point_indexe] op.Message(c4d.MSG_UPDATE) c4d.EventAdd() if __name__=='__main__': main()
    • C

      SOLVED Best way to fill a maxon::BaseArray
      General Programming & Plugin Discussions • c++ general programming brainstorming • • C4DS  

      6
      0
      Votes
      6
      Posts
      131
      Views

      Unfortunately, differently from std lib where it's possible to define and init a vector pretty easily using one-line statement( std::vector<int> a (10, 100);) this looks like being not currently possible with maxon::BaseArray() and you need to make it the usual way. Best, R
    • SOLVED Cinema4D S22 Debian user experiences?
      General Programming & Plugin Discussions • r21 brainstorming • • ferdinand  

      7
      1
      Votes
      7
      Posts
      263
      Views

      I

      Hello everyone. Will be ever C4D for Linux with GUI from Maxon? Not wine emulation. Sometimes want to switch linux.
    • SOLVED escape unicode characters in filepath
      General Programming & Plugin Discussions • python general programming brainstorming • • lasselauch  

      7
      0
      Votes
      7
      Posts
      128
      Views

      M

      Hi, @lasselauch as a rule of thumb with Python2.7 always store data as a Unicode string. Control your IO which means, for each, Input make sure you know the encoding in all cases by always calling .decode('utf-8') so you are sure to store a Unicode value and get an error if something went wrong at a loading time. Then output the content according to your need some need ASCII, some can work with unicode, but do the conversion on the fly, don't touch you stored Unicode data. For the francophone people, there is this fabulous article about unicode Encoding in Python for English I guess the best I found on this topic is A Guide to Unicode, UTF-8, and Strings in Python. Cheers, Maxime.
    • UNSOLVED Discussions about spline ik
      General Programming & Plugin Discussions • brainstorming • • chuanzhen  

      10
      0
      Votes
      10
      Posts
      136
      Views

      @zipit Thanks,this paper Parallel Transport Approach to Curve Framing I will follow your suggestion to explore RMF. It may be that the language barrier prevents us from communicating well, but I still get a lot of help from your answer. I use Google translate
    • K

      SOLVED Rendering render queue on program startup
      Cinema 4D Development • python brainstorming • • karol_w  

      5
      0
      Votes
      5
      Posts
      47
      Views

      M

      hello, thanks @PluginStudent :D @karol_w welcome to the forum, just want to point you to our forum rules, we marked that thread as a question and set it as solved. This help us to keep the forum organized. Be aware that a negative answer is still a "solved" question to us. please have a look at those thread to be a bit familiar with the forum's tools Q&A New Functionality. How to Post Questions especially the tagging part. Cheers, Manuel
    • C

      Communication between DescriptionTool and GeUserArea
      General Programming & Plugin Discussions • r20 c++ r21 r19 brainstorming • • C4DS  

      4
      0
      Votes
      4
      Posts
      87
      Views

      C

      @s_bach said in Communication between DescriptionTool and GeUserArea: The typical modern approaches are patterns like Model-View-Controller or Model-View-Presenter. In such models, you don't "send data around". Thanks for mentioning this. As stated in my opening post, this is what I have been using, where the "model" is a singleton class, available as a global variable to all plugins to synchronize and share data. Maybe not quite the exact wording. I was just wondering if there is another means of providing this "model" instead of using an instanced (singleton) class via a global variable? So in your example, the interaction with the DescriptionToolData would write data into the model. And the GeUserArea would read that data from the model. The example I provided isn't making use of a "model" as it already represented too much code just to point out the bug that slipped into R21. There I indeed used a very simplified solution by "sending data around". But an overall "thank you" for bringing up the model-view discussion, as this made me realize I could use an observer pattern in another project of mine which would fix its current poorly chosen design. Daniel
    • G

      SOLVED Python script for texture baking
      Cinema 4D Development • python brainstorming • • GHebert  

      7
      0
      Votes
      7
      Posts
      198
      Views

      G

      Thanks, @m_adam! That should put me a step closer.
    • D

      Mirror a matrix over a defined plane.
      General Programming & Plugin Discussions • python general programming brainstorming • • dany88  

      7
      0
      Votes
      7
      Posts
      218
      Views

      D

      @zipit Thank you. That'll help me.
    • J

      SOLVED Brainstorm :To automatically create a data comparison animation by python
      General Programming & Plugin Discussions • python general programming brainstorming • • Joe132  

      3
      1
      Votes
      3
      Posts
      216
      Views

      J

      @m_adam Thank you very much ! it is certainly helpful !!