The Maxon SDK Team is currently short staffed due to the winter holidays. No forum support is being provided between 15/12/2025 and 5/1/2026. For details see Maxon SDK 2025 Winter Holidays.
  • Get Point Positions of Selected N-Gon or Polygon

    11
    0 Votes
    11 Posts
    3k 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()
  • Our plugin is not showing up on the menu in just a few cases.

    4
    0 Votes
    4 Posts
    752 Views
    r_giganteR
    Hi Fernando, feel free to have the developer writing directly to our sdk support email box. Best, R
  • Script : Harden edges of all UV borders (break Phong shading)

    6
    3 Votes
    6 Posts
    2k Views
    M
    Wow, very nice! There's a huge progress, it now works pretty fast. Thanks for adding the wishlist items.
  • Plugin OnFloor Final 1.2.4RC1

    14
    4 Votes
    14 Posts
    5k Views
    J
    Grand merci pour ce Plugin tellement simple et facile d'utilisation. Grand merci... Many thanks for this Plugin so simple and easy to use. Big thanks
  • Mobile layout: Header takes too much space

    Moved
    5
    0 Votes
    5 Posts
    1k Views
    M
    The issue is fixed by the way.
  • This topic is deleted!

    2
    0 Votes
    2 Posts
    8 Views
  • Cannot Connect Xpresso Nodes in Python

    3
    0 Votes
    3 Posts
    801 Views
    M
    Hi, here in Cinema 4D S22 defining the type of the cloner I don't have anymore an issue import c4d from c4d import gui import math def main(): # Build Parent Cloner cloner = c4d.BaseObject(1018544) cloner[c4d.ID_MG_MOTIONGENERATOR_MODE] = c4d.ID_MG_MOTIONGENERATOR_MODE_LINEAR doc.InsertObject(cloner) # Build Null newnull = c4d.BaseObject(c4d.Onull) newnull.InsertUnder(cloner) # Build Children Cloner internal_cloner = c4d.BaseObject(1018544) internal_cloner[c4d.ID_MG_MOTIONGENERATOR_MODE] = c4d.ID_MG_MOTIONGENERATOR_MODE_GRIDARRAY internal_cloner.InsertUnder(newnull) internal_cloner.Message(c4d.MSG_MENUPREPARE, doc) # Cube cube = c4d.BaseObject(c4d.Ocube) internal_cloner.Message(c4d.MSG_MENUPREPARE, doc) cube.InsertUnder(internal_cloner) # Xpresso Tag xtag = c4d.BaseTag(c4d.Texpresso) cloner.InsertTag(xtag) # Setup Parent Cloner cloner[c4d.MG_LINEAR_OBJECT_POSITION, c4d.VECTOR_Y] = 0.0 cloner[c4d.MG_LINEAR_OBJECT_POSITION, c4d.VECTOR_Z] = 500.0 cloner[c4d.MG_LINEAR_COUNT] = 10 cloner[c4d.MGCLONER_VOLUMEINSTANCES_MODE] = c4d.MGCLONER_VOLUMEINSTANCES_MODE_RENDERINSTANCE # Setup Children Cloner internal_cloner[c4d.MG_GRID_SIZE] = c4d.Vector(300, 200, 100) # Setup Cube cube[c4d.PRIM_CUBE_LEN] = c4d.Vector(20, 10, 100) # Setup Xpresso # http://mograph.net/board/index.php?/topic/26338-creating-xpresso-nodes-with-python-script/ nodemaster = xtag.GetNodeMaster() node1 = nodemaster.CreateNode(nodemaster.GetRoot(), c4d.ID_OPERATOR_OBJECT, None, 100, 100) node1[c4d.GV_OBJECT_OBJECT_ID] = internal_cloner gridResParam = c4d.DescID(c4d.DescLevel(c4d.MG_GRID_RESOLUTION, c4d.DTYPE_VECTOR,0), c4d.DescLevel(c4d.VECTOR_Z, c4d.DTYPE_REAL,0)) node1out = node1.AddPort(c4d.GV_PORT_OUTPUT, gridResParam) node2 = nodemaster.CreateNode(nodemaster.GetRoot(), c4d.ID_OPERATOR_OBJECT, None, 300, 100) node2[c4d.GV_OBJECT_OBJECT_ID] = cloner posParam = c4d.DescID(c4d.DescLevel(c4d.MG_LINEAR_OBJECT_POSITION, c4d.DTYPE_VECTOR,0), c4d.DescLevel(c4d.VECTOR_Z, c4d.DTYPE_REAL,0)) node2in = node2.AddPort(c4d.GV_PORT_INPUT, posParam) # Connect if node1out is not None and node2in is not None: node1out.Connect(node2in) c4d.EventAdd() # refreshed viewport to see changes automatically if __name__=='__main__': main() And as pointed by @PluginStudent the problem was because the AddPort fails. And I guess it failed because at the time you ask for the port creation since no explicit mode was defined in the Cloner the XPresso description was not properly fed so this GvPort didn't exist. Cheers, Maxime.
  • How to Add Multiple Redshift Pazzle Matte AOVs

    python
    2
    1
    0 Votes
    2 Posts
    1k Views
    ManuelM
    hi, if you wants to know how many AOVs you need for 10 objects you should use Ceil. After that, some math to have your ID raising by 1. numberOfAOVs = math.ceil(10 / 3.0) # will give you 4 for i in xrange(int(numberOfAOVs)): print ("create aov number {}".format(i)) for j in xrange (3): print ("value of field will be : {}".format(j + i * 3 ) ) I'm not a big fan of retrieving all the objects on each function. But first, make things works, than optimize. (at least at the beginning) Cheers, Manuel
  • Create a Redshift Camera with Python

    python r21
    3
    0 Votes
    3 Posts
    680 Views
    C
    Thanks! For whatever reason I couldn't get that particular code to work, but I eventually figured out a different method. I think my script is finished for now.
  • "Axis Center " Script button reuse problem

    r21 python
    3
    0 Votes
    3 Posts
    702 Views
    X
    Thank you very much for your help to solve the previous doubts. I will continue to work hard.
  • How to move splines in Python Generator?

    3
    1
    0 Votes
    3 Posts
    671 Views
    S
    Thanks for the answer. I will check it.
  • Left-Hand Local Coordinates to Right-Hand Local Coordinates?

    python
    4
    0 Votes
    4 Posts
    1k Views
    dskeithbuckD
    Thank you @zipit and @m_magalhaes for your replies! @zipit your response put me on the right track. The issue was that I was trying to do all of the conversions using C4D's left-handed coordinate matrices, and it was auto-fixing my "malformed" matrices. I ended up porting the Three.js Matrix4 and Euler classes from JS to python and using them in my script. So, the final code (leaving out the ported methods) looked something like: mg = self.op.GetMg() parent_mg = self.op.GetUpMg() c4d_to_three = c4d.Matrix( off=c4d.Vector(0), v1=c4d.Vector(1, 0, 0), v2=c4d.Vector(0, 1, 0), v3=c4d.Vector(0, 0, -1) ) # Convert to new coordinate space # http://www.techart3d.com/2016/02/convert-left-handed-to-right-handed-coordinates/ mg_three_coords = c4d_to_three * mg * c4d_to_three parent_mg_three_coords = c4d_to_three * parent_mg * c4d_to_three mg_mat4 = Matrix4(mg_three_coords) parent_mg_mat4 = Matrix4(parent_mg_three_coords) inv_parent_mg_mat4 = parent_mg_mat4.Clone() inv_parent_mg_mat4 = inv_parent_mg_mat4.Inverse() node_local = inv_parent_mg_mat4.Clone() node_local = node_local.MultiplyMatrices(inv_parent_mg_mat4, mg_mat4) position, scale, rotation = node_local.Decompose() if position != c4d.Vector(0): self.props["position"] = position if scale != c4d.Vector(1): self.props["scale"] = scale if rotation != c4d.Vector(0): self.props["rotation"] = rotation
  • Stuck with loop through tags

    python
    4
    0 Votes
    4 Posts
    899 Views
    ManuelM
    hi @SuperHomiak welcome to the forum. Thanks @zipit for the answer For your next threads, please help us keeping things organised and clean. I know it's not your priority but it really simplify our work here. Q&A New Functionality. How to Post Questions especially the tagging part. I've set the thread to a question and marked zipit answer as the right answer Cheers, Manuel
  • This topic is deleted!

    1
    0 Votes
    1 Posts
    14 Views
    No one has replied
  • Question about IDs for Python Dialog

    python
    3
    0 Votes
    3 Posts
    565 Views
    ManuelM
    hi, I'll set this thread as solved without feedback from your side. Cheers, Manuel
  • Access Class B's function inside Class A?

    r21 python
    5
    0 Votes
    5 Posts
    807 Views
    B
    @Cairyn @zipit @C4DS Thank you all for the responses. I ended up with @C4DS suggestion in using SpecialEventAdd() and CoreMessage for simplicity sake. Have a great day ahead!
  • Python - InExcludeData initialization problem

    5
    1
    0 Votes
    5 Posts
    1k Views
    ferdinandF
    Hi, @SolarPH said in Python - InExcludeData initialization problem: Now I know that initializing the InExcludeData is not InExcludeData.__init__ and the correct way was c4d.InExcludeData(), ... I am not quite sure how you did mean this, but InExcludeData.__init__ is one of the methods called when you invoke c4d.InExcludeData(). Like all double underscore methods __init__ implements an operator, in that case the construction operator. Invoking SomeClass() will first call the constructor SomeClass.__new__ and after that the initialisator SomeClass.__init__. Due to the fact that __new__ only rarely has to be implemented explicitly and because people are accustomed to talking about constructor functions, __init__ is also often called a constructor, while technically it is just the initialisator. A prime example would be both the InExcludeData documentation and my example code, which both talk about a copy constructor, but are actually referring to __init__ and not __new__. Cheers, zipit
  • Create Proper Hierarchical Data for TreeView?

    r21 python
    11
    0 Votes
    11 Posts
    2k Views
    B
    Thanks for the clarification. Have a great day ahead!
  • Hide Layer in Layer Manager

    3
    0 Votes
    3 Posts
    600 Views
    SwinnS
    Got it. Thanks.
  • Remove object from layer

    4
    0 Votes
    4 Posts
    865 Views
    SwinnS
    @PluginStudent said in Remove object from layer: op[c4d.ID_LAYER_LINK] = None op[c4d.ID_LAYER_LINK] = None c4d.EventAdd() did it! Thanks! As you can tell from my previous code, I am hacking my way through Python. If you saw the rest of it, you would probably have to sit down and maybe drink a Gatorade. Or something stronger.