Isotropix Forums

Help with the get_bbox_at() method

Clarisse Scripting related topics

Help with the get_bbox_at() method

Unread postby alexey » Wed Nov 04, 2020 2:08 am

Hello everyone,

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
alexey
 
Posts: 8
Joined: Fri Jun 05, 2020 1:11 am

Re: Help with the get_bbox_at() method

Unread postby anemoff » Wed Nov 04, 2020 12:16 pm

Hi,
CtxEval is not exposed in Python. So you'll have to use the workaround.
Anthony Nemoff
Isotropix
R&D Engineer
User avatar
anemoff
 
Posts: 391
Joined: Wed Jan 13, 2016 10:10 am

Re: Help with the get_bbox_at() method

Unread postby alexey » Wed Nov 04, 2020 3:26 pm

Thank you, Anthony!

Alexey
alexey
 
Posts: 8
Joined: Fri Jun 05, 2020 1:11 am


Return to Scripting