Everything related to SDK.
By d76
#380546
Hello
can anybody explain this behavior please? what i intend is to make mirrored instance, but result is not as expected. when i clone object, everything works well..

edit: Forgot to mention that the base cube is not transformed. Directly taken from library as it is.
Code: Select all
#!/Library/Frameworks/Python.framework/Versions/3.2/bin/python3
# -*- coding: utf-8 -*-

from pymaxwell import *

scene = Cmaxwell(mwcallback)
scene.readMXS("Cube.mxs")
c = scene.getObject("Cube")

o = scene.createInstancement("Cube2", c)
b, p = c.getBaseAndPivot()
b.xAxis = Cvector(b.xAxis.x() * -1.0, b.xAxis.y(), b.xAxis.z())
o.setBaseAndPivot(b, p)

scene.writeMXS("Cube2.mxs")
Image
User avatar
By Brany
#380705
Maybe the problem here is get/setBaseAndPivot are ignored when scene is opened in Studio. Rendering the scene in maxwell directly must work. I tried to make a mirrored cube and it worked for me:
Code: Select all
from pymaxwell import *

scene = Cmaxwell(mwcallback)
scene.readMXS("d:/Cube.mxs")
c = scene.getObject("Cube")

o = scene.createInstancement("Cube2", c)
b, p, ok = c.getBaseAndPivot()
print b
print p
b.xAxis = Cvector(b.xAxis.x() * -1.0, b.xAxis.y(), b.xAxis.z())
b.origin = Cvector(b.origin.x() , b.origin.y() + 2, b.origin.z())
print b
print p
o.setBaseAndPivot(b, p)

scene.writeMXS("d:/Cube2.mxs")

parameters = [];
parameters.append('-mxs:d:/Cube2.mxs');
parameters.append('-sl:3');
runMaxwell(parameters);
And the result is:

Image

bottom cube is the original one, top cube is the mirrored one (translated up 2 meters too)
By d76
#380720
Thanks for reply, you were right, render is ok but in Studio it is rotated. The same if i render it directly from Studio or saved as new mxs from Studio..
Will test in 3.0 tomorrow, maybe it is time to upgrade also my scripts.. or fill bug report..
User avatar
By Brany
#380729
Anyway, we have to improve our API to handle object transformations properly, so Studio and Maxwell can handle the Maxwell API transformations in a straight way.

Maxwell Render is not an "animation" platform, thats why object transformations are not well supported by now. But with the python API users started to "animate" things by code, so I hope we can offer a good API for this, please be patience!

...and 3 Days later, 82.528 Views !!! ...NL, every[…]

Hello dear customers, We have just released a new[…]

grass generator extension

Just downloaded MWR5 for Rhino 6 and want to use g[…]

Hello everyone, I have a new bug with the latest M[…]