I'd be appreciated if someone could explain how to get a bounding box at a specific time. I am trying to use the get_bbox_at() method, but it requires a CtxEval object as a first argument and (I guess) a time value as the second. I have no problem getting a current time, but I don't have any idea how to create a CtxEval object - I see nothing in ix.api.
- Code: Select all
#Pseudo code:
obj = ix.selection[0]
ctx_eval = ?
time = ix.application.get_current_time()
object_space_bbox = obj.get_module().get_bbox_at(ctx_eval, time)
obj_world_matrix = obj.get_module().get_global_matrix_at(time)
world_space_bbox = ix.api.GMathBbox3d()
object_space_bbox.transform_bbox_and_get_bbox(obj_world_matrix, world_space_bbox)
Of course, as a workaround, I can loop every frame and use the get_bbox() method within the loop, but it doesn't look cool at all.
Any examples of getting an object's bbox at a specific time are highly welcome!
I really appreciate any help you can provide,
Alexey