Community
Arnold General Rendering Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

AiUniverseGetSceneBounds() question

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
sombersound.genetics
109 Views, 2 Replies

AiUniverseGetSceneBounds() question

I am starting to question if I am fundamentally misunderstanding this.

I'm working on a script to generate thumbnails. The script must be plugin-agnostic, so I cannot rely on the host. So, I'd like to use the the scene bounds to calculate the distance of the camera so that the size of the subject remains somewhat constant relative to the frame.

I assumed that AiUniverseGetSceneBounds() would be what I was wanting. But even when the scene bounds are writen to the .ass header, or when including an .asstoc file, AiUniverseGetSceneBounds() returns an AtBbox object with ({0,0,0},{0,0,0}).

Here is the code that I'm using:

AiBegin()
AiASSLoad(myass, AI_NODE_ALL)
bounds = AiUniverseGetSceneBounds()
AiEnd()


bounds.max.y (or any other axis) always returns zero.

The header is as follows:

### exported: Fri Apr 12 12:00:58 2019
### from:     Arnold 5.1.0.1 [8698598b] darwin clang-5.0.0 oiio-1.7.17 osl-1.9.0 vdb-4.0.0 clm-1.0.3.513 rlm-12.2.2 2018/04/17 17:32:11
### host app: C4DtoA 2.3.0.1 | Cinema4D 19068
### bounds: -1.000000 -1.000000 -1.000000 1.000000 1.000000 1.000000
### user: REDACTED
### fps: 30.000000
### frame: 0.000000
### scene: Untitled 3


It's not a huge deal. I can just read the .ass file's header and extract the bounds, but it'd sure be nice to avoid that. What exactly am I doing wrong?

2 REPLIES 2
Message 2 of 3

I suspect you'll have to call AiRender(AI_RENDER_MODE_FREE) to force the calculation of the scene bounds.



// Stephen Blair
// Arnold Renderer Support
Message 3 of 3

FINALLY! Thank you! My guess is then I won't actually need the bounds pre-defined, either.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report