![maya python ls command dont list all duplicates maya python ls command dont list all duplicates](https://i.stack.imgur.com/7JyTN.png)
# if the object's transforms have been frozen, we don't want the input3D values to also be 0 NormXform = cmds.createNode("plusMinusAverage", n="normalizeXform#")Ĭmds.connectAttr(controller + ".translate", normXform + ".input3D") # note: works only if there are no SDK groups above the controller that are already affecting its xform # this node normalizes the transformations of the controller by subtracting its original location. # because it's sorted, we know the shortest distance is at the start of the array and the longest is at the end # sorts our array by the second value, distanceĭistances = sorted(distances, key=lambda x: x) Will affect its influence amtĭistances.append() # an array of the the distance each object is from our controller object. # create max and min Inf attributes on the controller so that the user can change themĬmds.addAttr(controller,at="enum",en="Soft_Select",ln="_")Ĭmds.setAttr(controller + "._",k=0,cb=1,l=1)Ĭmds.addAttr(controller, at="float", ln="Min_Inf", dv=minInf, min=0, max=1, k=1)Ĭmds.addAttr(controller, at="float", ln="Max_Inf", dv=maxInf, min=0, max=1, k=1)Ĭmds.addAttr(controller, at="float", ln="Envelope", dv=1, min=0, max=1, k=1) # quit if no objects are passed to influence # 3d distance formula is the square root of (x2-x1)**2 + (y2-y1)**2 + (z2-z1)**2ĭistance = math.sqrt(((pointA - pointB) ** 2)ĭef objSoftSelect(influenced=None, controller=None, maxInf=.5, minInf=.01): PointB = cmds.xform(objB, q=1, piv=1, ws=1) PointA = cmds.xform(objA, q=1, piv=1, ws=1)
![maya python ls command dont list all duplicates maya python ls command dont list all duplicates](https://i.ytimg.com/vi/eXFGeZZbMzQ/maxresdefault.jpg)
# query the object's rotate and scale pivot instead of its translate value for more accuracy # on their initial distance from the object. One object can influence a group of objects and their influence is based
![maya python ls command dont list all duplicates maya python ls command dont list all duplicates](https://i.stack.imgur.com/RJy0p.gif)
My only wish is that I could have it all in just a single node (like a custom remapValue node) that will allow me to control the falloff curve shape. Turns out, that remapValue node really did the trick. In the back of my mind I had the idea of using the remapValue node (because that’s essentially what I’m trying to do) so I gave it a shot. Many a Starbucks drinks were spent on it, but alas, nothing. Now, for a few days I was trying to write my own falloff formula. I’m calling it “object soft select” because what it does is it takes a group of objects and a controller and makes those objects be influenced by the controller object with an influence falloff based on the distance the object is from the controller. If I thought ahead I would have set up some selection sets, but alas I did not.Today’s script is a really cool one because it can be used to really add appeal to rigs. I would like to just be able to type in for selection. And I still need to actually select the things too. So is there a way to do this? I know I can use the filter thing in the outliner but it still makes me drill down through the groups to find the filtered objects. For example, "Tire_01", "Tire_LFT", "RT_Tire", etc. The good thing is that I know I named them all "Tire_01." So is there a way to just type in "Tire_01" and have it select all the objects with that name? Even better for me would be if I could type in "tire" and it would select all the objects with "tire" in the name. The problem is that they are all grouped to their respective cars and I dont want to have to waste time digging into each group to find the tires. For example, say I am making a scene with a bunch of cars. Is there a way to select multiple objects that have the same name, or even better, a similar name with minor variation. I have a simple question, and I'm hoping it has a simple answer.