Bounding box of input geometry

Forums: Bounding box of input geometry
Forum for OctaneRender Lua scripting examples, discussion and support.

Bounding box of input geometry

Postby jobigoud » Sat Dec 10, 2022 4:53 pm

jobigoud Sat Dec 10, 2022 4:53 pm
Hello,

Here is a script that produces the bounding box of the input geometry.
The bounding box is output in the form of two points representing the minimum and maximum corners.

Geometry: the geometry you want to compute the bounding box of. It supports groups and placements.

Live update: If it is checked, it will constantly update the bounding box any time the input changes. This includes changes in material or textures because we don't have a way to distinguish between these changes and geometry changes at the script level.
If it is not checked, it will only update the bounding box when you click on the "play" button on the script.
Basically if the geometry is very heavy, uncheck it so it doesn't trigger the computation while you update materials.

Limitations:
- It only supports polygon-based geometry for now. No hairs, particles, volumes or vectron.
- It does not support scatter nodes.

The demo scene shows how to align a plane with the bottom of the bounding box.
The script itself should work in any decently recent version of Octane but the demo ORBX uses the new value math nodes from 2022.1.

Let me know of any issues or feedback.
Thanks

bbox-demo.orbx
(66.63 KiB) Downloaded 162 times


BoundingBox.lua
(9.02 KiB) Downloaded 163 times
User avatar
jobigoud
OctaneRender Team
OctaneRender Team
 
Posts: 230
Joined: Sat Aug 15, 2015 1:28 pm

Re: Bounding box of input geometry

Postby jitendra » Sun Dec 11, 2022 8:52 am

jitendra Sun Dec 11, 2022 8:52 am
Thank you so much for sharing this.
This is working with the latest stable version of the octane.
However, in OctaneRender Studio 2022.1 XB4 for Windows, the ORBX crashes while opening.
I will test it today for OctaneRender Studio 2022.1 RC 3 for Windows.

Thanks once again :)
Jitendra.

jobigoud wrote:Hello,

Here is a script that produces the bounding box of the input geometry.
The bounding box is output in the form of two points representing the minimum and maximum corners.

Geometry: the geometry you want to compute the bounding box of. It supports groups and placements.

Live update: If it is checked, it will constantly update the bounding box any time the input changes. This includes changes in material or textures because we don't have a way to distinguish between these changes and geometry changes at the script level.
If it is not checked, it will only update the bounding box when you click on the "play" button on the script.
Basically if the geometry is very heavy, uncheck it so it doesn't trigger the computation while you update materials.

Limitations:
- It only supports polygon-based geometry for now. No hairs, particles, volumes or vectron.
- It does not support scatter nodes.

The demo scene shows how to align a plane with the bottom of the bounding box.
The script itself should work in any decently recent version of Octane but the demo ORBX uses the new value math nodes from 2022.1.

Let me know of any issues or feedback.
Thanks

bbox-demo.orbx


BoundingBox.lua
Best Regards, Jitendra
jitendra
Licensed Customer
Licensed Customer
 
Posts: 140
Joined: Sat Oct 16, 2010 6:09 am

Re: Bounding box of input geometry

Postby jobigoud » Mon Dec 12, 2022 5:20 pm

jobigoud Mon Dec 12, 2022 5:20 pm
Now that 2022.1 stable is out you should definitely use this one rather than XB or RC build.
The crash is unfortunate but it's not related to that particular ORBX, it will happen with other scenes doing this downgrade. Upgrading scenes saved in XB/RC into the stable build should work.
User avatar
jobigoud
OctaneRender Team
OctaneRender Team
 
Posts: 230
Joined: Sat Aug 15, 2015 1:28 pm

Re: Bounding box of input geometry

Postby jitendra » Tue Dec 13, 2022 1:19 pm

jitendra Tue Dec 13, 2022 1:19 pm
You are right. I just am using the stable and it is working perfectly.
Thank you so much for sharing it. Appreciate it!

jobigoud wrote:Now that 2022.1 stable is out you should definitely use this one rather than XB or RC build.
The crash is unfortunate but it's not related to that particular ORBX, it will happen with other scenes doing this downgrade. Upgrading scenes saved in XB/RC into the stable build should work.
Best Regards, Jitendra
jitendra
Licensed Customer
Licensed Customer
 
Posts: 140
Joined: Sat Oct 16, 2010 6:09 am

Re: Bounding box of input geometry

Postby jitendra » Tue Feb 27, 2024 5:50 am

jitendra Tue Feb 27, 2024 5:50 am
Hi, This script has been very useful, however, it doesn't support the material map node.
I have attached the same example with the issue. If anyone can help fix it, it will be of great help.
Jitendra
Attachments
bounding-box-material-map-issue.ocs
(88.51 KiB) Downloaded 23 times
Best Regards, Jitendra
jitendra
Licensed Customer
Licensed Customer
 
Posts: 140
Joined: Sat Oct 16, 2010 6:09 am

Return to Lua Scripting


Who is online

Users browsing this forum: No registered users and 19 guests

Sat Apr 27, 2024 9:39 am [ UTC ]