[Closed] Scale the verts "brake" the node local boundingbox. Why?
As you can see in the gif image, when I use the script to scale the box(converted to Editable_Poly) there is no problem. The script get all verts of the box and move them to new positions.
Then I move some verts of the box and use the same code again to scale the box, but this time the box is scaled, but its boundingbox do not update. When I convert the box to editable_poly the bbox is updated.
The code, that I use:
(
local curObj = selection[1]
local allObjVerts = #{1..(polyop.getNumVerts curObj)}
local poGetVert = polyOp.getVert
local poSetVert = polyOp.setVert
local objCenter = [0,0,0]
local vPosArr = #()
for v in allObjVerts do
(
vpos = poGetVert curObj v
append vPosArr vPos
objCenter += vPos
)
objCenter /= vPosArr.count
local newMatrix = (transMatrix -objCenter)*(scaleMatrix [2,2,2])
local cnt = 0
for v in allObjVerts do ( poSetVert curObj v ( ( vPosArr[cnt += 1] * newMatrix )+objCenter) )
)
Am I doing something wrong?
Update does not help at all.
Using this
for v in allObjVerts do ( poSetVert curObj v ( ( vPosArr[cnt += 1] * newMatrix )+objCenter) )
update ObjToScale
at the end of the code do not update the bbox.
Or, maybe there is another method to update the editable poly?
Yes, converting to EP solve the problem, but I am curious why this happen.
Denis, about my PM, I will try to do what you offer me. Thank you.
notifydependents curObj partid:#geom
and
notifydependents curObj partid:#all
not work. The bbox is not updated.
hmm… updates for me. what max version do you use? what viewport driver is?
PS. simple update works as well.
max 2010/64 and 2012/64, Direct3D.
Yes, works on max2009 Direct3D, but not work on max2012 and 2013 Nitrous.
that’s a Nitrous problem. A lot of things don’t work with Nitrous.
but I tested in max 2012/64 with Nitrous. it works without any update. Graphic Card / Driver issue?
Driver Version 296.10
I hope the problem will be on my PC only.
Thank you/
When I apply the XForm the bbox of the object automatically updates. No need to scale the gizmo. But appplying modifiers to update the bbox is not a solution.
It is not a solution it is a work around and isn’t that what Max is all about:)