[Closed] polyop.SetVert works much differen't on .BaseObject
I’ve run into a wierd issue with the .baseObject Property.
If I do polyop.setVert on the actual node, it’s fine. But if I do the same on the $.baseObject,
the position that it uses it not at all what it should be.
I’m not sure why or where its setting the positions to, but its not even opposite of what it should be, its completely differen’t. Unless its working out of Local Space?
It seems like for a temp Fix, I can turn Off/On the Modifiers and just use the standard object.
I was using baseObject to get around them, but its not wanting to work right… :shrug:
yes if you operate on the baseobject it works in local space. you can convert your world space position to local space by multiplying by the inverse of the object’s transform:
localPos = worldPos * inverse obj.objectTransform
Hm… I thought it had it working for a second, but nope :(.
I’m trying
verts = polyop.getVertsUsingEdge selection[1].baseObject (polyop.getEdgeSelection selection[1].baseObject)
moveVertt = polyop.moveVert
pGetVert = polyop.getVert
for vert in verts do
(
print vert
local pnt = pGetVert selection[1].baseObject vert node:Selection[1]
pnt = (pnt * (inverse selection[1].objectTransform))
print pnt
moveVertt selection[1].baseObject vert ((polyop.getVert $Sphere001 142)-pnt)
)
Well I went back to just turn On/Off Modifiers, which works fine. This time I took into account which ones were already On/Off and went from there.
why don’t you try using SETVERT, take the initial pos of vert and do a set vert by pos + value you want…set vert works well with me at BASEOBJECT level…
Well I need to do an offset in a direction of a Normal.
So I could do in Coordsys Normal, but that won’t help me in SetVert.
i know only two reasons to use moveverts instead of setverts:
#1. if you need to move group of vets with the same offset
#2. if you want to move with soft selection…
the moving in normal space is not the one of them.
honestly in my practice i’ve never used polyop interface for .baseobject. i’ve never seen a reason. and i don’t think that your case is special.
if you need to get vert position as fast as possible use trimesh of the object.
That is Why. I need to offset a vert or offset with soft selection.
Also I don’t want to use meshes because of limited modeling methods.
My script needs to offset/move verts in realtime as you model.
but why is the .baseobject? can you explain what you really want to do? i feel that you are doing something wrong, or i’m missing something.
Don’t know what you exactly you want to do, but I have a formula for you:
This is what you have to do
- I dont know how you will find out a normal of a vertex using polyop, but get that.
- Either use mesh or any of your methods
Then,
theVertPos = polyop.GetVert $.baseObject vNum
theNormal = (The normal of the vertex vNum, the way you find it…)
The Maths:
theValue = (constant offset value you choose)
newPos = theVertPos+(theNormal*theValue)
polyop.setvert $.baseobject vNum newPos
It works with me…