Open je-cook opened 5 months ago
Track camera position
def callback(*args):
cam, sensor = args
print()
print("Cam position : {}".format(cam.position.getValue().getValue()))
print("Cam rotation : {}".format(cam.orientation.getValue().getValue()))
camera = viewer.getSoEventManager().getCamera()
node_sensor = coin.SoNodeSensor(callback, camera)
node_sensor.attach(camera)
Fixed in #3304
Description of issue / requirement to address
Our freecad cad viewer has a slight hack in it that rotates the CAD instead of the camera of the viewer
Proposed solution
The camera can be accessed here: https://github.com/Fusion-Power-Plant-Framework/bluemira/blob/4eb798780bd379a562a5872f710bb4fc18eb0325/bluemira/codes/_freecadapi.py#L2407 with some of the below dump of exploratory code being useful, its half translated from c++ ie the pointers dont work:
With the above you need to remvoe the rotate=True from the viewer and the rotate argument completely as mentioned in #3235
Alternative solutions
leave as is, it does work.
Additional context
This may lead to us being able to specify the viewing angle say for an autogenerated image in future.