python maya: Align group pivot to supplied position -


I have a script here where I will create a bundle of circle and place them in a group. Then I pitch the groups in the bounding box. In the end, I want to align the position of the group in the position of the position by collecting the first locketers position. How do I fix it? Currently it does not seem to be aligning properly. The error is in the last line of the code. Thanks to the advanced people Importing CMD cmds.file (new = true, f = true) a = cmds.spaceLocator (n = 'pipeCtrl_00') x = random .uniform (- 10,10) z = random.uniform (-10,10) cmds.xform (a, t = (x, 0, z)) Select all locators that you want to decrease on locList = cmds. ls (type = 'locator') nodes = maya.cmds.listRelatives (locList, type = 'transform', parent = true) Sorted (nodes) point = [] # Nodes in position number for: pos = cmds .xform (n, q = true, ws = true, t = true) points.append (pos) # Create 2D grid of circle numRows = 4 numColumn = 4 # Create empty groups for nodes nodeGroup = cmds.group (em) = True, name = 'Pipe_group_00') for r in range (0, numrows): for boundary (0, numColumns), C: # circle shape and create node = CMD. Serial (ch = true, o = true, nr = (0, 0, 1), c = (0, 0, 0), r = .5) cmds.xform (node, t = (r * (.5 * 2), C * (.5 * 2), 0)) # Group node cmds.parent (node ​​[0], node group, relative = false) # # node of the group cmd.xform (node ​​group, cp = true) # Align group to row # ---------------------------------------- --- ----------------------- Print Issue [0] cmds.xform (nodeGroup, ws = true, t = number [0]) < / pre>

I think you want

  cmds.xform (nodeGroup , cp = true, p = true)   

-p flag

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -