Sorry for the late reply but I didn't notice this thread earlier.
Based on your code snippets I put together this example which worked in 0.16 as you expect it.
Code: Select all
ScrewObj_m=App.ActiveDocument.addObject("Part::Box","Box")
App.ActiveDocument.recompute()
pl = FreeCAD.Placement()
pl.Rotation = (1,1,1,0.5) #Drehungs-Quaternion
neuPlatz = ScrewObj_m.Placement
neuPlatz.Rotation = pl.Rotation.multiply(ScrewObj_m.Placement.Rotation)
neuPlatz.move(App.Vector(2,4,6))
But now look at this example
Code: Select all
ScrewObj_m=App.ActiveDocument.addObject("Part::Box","Box")
App.ActiveDocument.recompute()
pl = FreeCAD.Placement()
pl.Rotation = (1,1,1,0.5) #Drehungs-Quaternion
neuPlatz = ScrewObj_m.Placement
neuPlatz.Rotation = pl.Rotation.multiply(ScrewObj_m.Placement.Rotation)
ScrewObj_m.Placement = FreeCAD.Placement()
neuPlatz.move(App.Vector(2,4,6))
It has only one additional line
Code: Select all
ScrewObj_m.Placement = FreeCAD.Placement()
to overwrite the old placement so that
neuPlatz isn't the placement of
ScrewObj_m any more. But the code still shows the same effect because internally
neuPlatz still knows about its previous "parent" object and thus applies the transformation to it which is clearly wrong.
To fix your problem with the new version you have to explicitly assign the placement again at the end
Code: Select all
ScrewObj_m=App.ActiveDocument.addObject("Part::Box","Box")
App.ActiveDocument.recompute()
pl = FreeCAD.Placement()
pl.Rotation = (1,1,1,0.5) #Drehungs-Quaternion
neuPlatz = ScrewObj_m.Placement
neuPlatz.Rotation = pl.Rotation.multiply(ScrewObj_m.Placement.Rotation)
neuPlatz.move(App.Vector(2,4,6))
ScrewObj_m.Placement = neuPlatz