Hi,
@andmotion said:
#get matrix and points from polyObj
polyObjWSMg = polyObj.GetMg().off
You did not assign a matrix topolyObjWSMg
but the offset vector off the global matrix of polyObj
.
@andmotion said:
pointPos = polyObjWSMg * point
Which will make pointPos
here not a c4d.Vector
but a float
- the dot product of two vectors. You also don't have to calculate the global point positions in your loop if you find that distracting, you can just do:
mg = polyObj.GetMg()
global_points = [mg * p for p in polyObj.GetAllPoints()]
distance_squared = 100 ** 2
null_mg = null.GetMg()
for pid, point in enumerate(global_points):
if (null_mg * point).GetLengthSquared() < distance_squared:
selection.Select(pid)
And regarding odd behaviour and want you want to do, I would point to my first post. Still sounds to me you actually want to evaluate a gradient.
Cheers
zipit