Message 1 of 9
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
could you help how to duplicate object using python script ind 3Dmax 2018?
Regards,
MZ
Solved! Go to Solution.
Hi,
could you help how to duplicate object using python script ind 3Dmax 2018?
Regards,
MZ
Solved! Go to Solution.
If you just want to copy the selected node, you could do it like this:
from pymxs import runtime as rt # get the selected node sel = rt.selection[0] # copy selected node rt.copy(sel)
Hi,
thank you for your response.
I have found second way:
MaxPlus.Core.EvalMAXScript("myType = #copy") rt.maxOps.cloneNodes(rt.mySphere2, cloneType=rt.myType)
My goal is to create a vector field (space of 3d of arrows):
I do not know how to draw an arrow using python code, so I would like to clone an already created one. Then I plan to give them rotation and location later. What do you think is the best way to achieve this?
that works too 🙂
If you want to get rid of the EvalMaxScript part, you could do it like this:
rt.maxOps.cloneNodes(sel, cloneType = rt.name("copy"))
and to create a grid of objects:
count = 3 offset = 50 for x in range(count): for y in range(count): for z in range(count): node = rt.teapot() node.pos = rt.point3(x*offset, y*offset, z*offset)
Perfect!
Thank you for help, now I know also how to create an arrow, but do you know how to connect these two objects into one node?
node=pymxs.runtime.cone() node.radius1=1.8 node.height=3.5 node.pos=rt.point3(0,0,5) node=pymxs.runtime.cylinder() node.radius=0.9 node.height=5 node.pos=rt.point3(0,0,0)
import pymxs
cone=pymxs.runtime.cone()
cone.radius1=1.8
cone.height=3.5
cone.pos=rt.point3(0,0,5)
cylinder=pymxs.runtime.cylinder()
cylinder.radius=0.9
cylinder.height=5
cylinder.pos=pymxs.runtime.point3(0,0,0)
pymxs.runtime.convertToMesh(cone)
pymxs.runtime.convertToMesh(cylinder)
pymxs.runtime.attach(cone, cylinder)
arrow = cone
arrow.pivot = pymxs.runtime.point3(0,0,0)
Thanks to you, right now I am very close to finish this task!
I hope that will be a last question, do you know how to assign material to each node?
I would like to do smh like this:
1. Select node 1,
2. assign to the node Scanline -> Standard,
3. Set the color, and material properties.
from pymxs import runtime as rt tpot = rt.Teapot() mat = rt.StandardMaterial() tpot.material = mat mat.Diffuse_Color = rt.color(255, 0, 0)
Hi,
how to select standard material I know, but how to select a different one and then control its parameters?
Mateusz