I have a technical Python question which I can't seem to solve.
The following script is used to store the points in an object, then reset the rotation of the object and then put the points back into their old position:
if (Object.GetType() == c4d.Opolygon) or (Object.GetType() == c4d.Opoint):
oldm = Object.GetMg()
points = Object.GetAllPoints()
pcount = Object.GetPointCount()
newm = Object.GetMg()
for p in range(pcount):
This works very well, however I'm running into a problem if I look under the Coordinate Manager of the object and then it's size. Under size the object still appears to be in it's old orientation at first glance.
However, if I click on any of the size values and then simply hit enter, all the values jump around to the give the object it's correct orientation again.
For instance, the longest axis is initially the "Z" axis (old orientation) but when I click the value and hit enter, the contents of the "Z" axis jump to the "Y" axis where they should be.
My question is two fold:
Currently I read the bounding box of the/multiple objects and compile a custom bounding box afterwards, but this currently has the wrong orientation because the size parameters are not in the correct axis.
Did you update the object? Can't see that in your code as posted.
API docs say:
"Call obj.Message (c4d.MSG_UPDATE) after you set all your points to update the object."
Which normally recalculates the bounding box (and whatever internal data the object holds).
Well, that indeed fixed the issue, now the size gets properly updated!
Thank you very much for the help