Are non-modal windows possible

Forums: Are non-modal windows possible
Forum for OctaneRender Lua scripting examples, discussion and support.

Are non-modal windows possible

Postby abzivid » Fri Oct 15, 2021 5:03 pm

abzivid Fri Oct 15, 2021 5:03 pm
Hi,
I would like to create a non modal window to drive object location randomization to generate variations in the scene.

Is this possible at all?
Any other approaches?

Many thanks
Aleksandar
abzivid
Licensed Customer
Licensed Customer
 
Posts: 15
Joined: Thu Sep 30, 2021 9:11 am

Re: Are non-modal windows possible

Postby abzivid » Sat Oct 16, 2021 5:50 am

abzivid Sat Oct 16, 2021 5:50 am
Think I have found a way to solve my issue.
See the code below that randomizes geometry's translational and rotational placement.


There, octane.changemanager.update() call can be used to keep the window live while updating the scene.

Code: Select all
local function Randomize()
    local rndRotate = {math.random(-maxXRot.value,maxXRot.value), math.random(-maxYRot.value,maxYRot.value), math.random(-maxZRot.value,maxZRot.value)}
    local rndTranslate = {math.random(-maxXTr.value, maxXTr.value)/100, math.random(-maxYTr.value, maxYTr.value)/100, math.random(-maxZTr.value, maxZTr.value)/100}
    placementTransformation:setAttribute(octane.A_ROTATION, rndRotate)
    placementTransformation:setAttribute(octane.A_TRANSLATION, rndTranslate)
    octane.changemanager.update()
end
abzivid
Licensed Customer
Licensed Customer
 
Posts: 15
Joined: Thu Sep 30, 2021 9:11 am

Return to Lua Scripting


Who is online

Users browsing this forum: No registered users and 6 guests

Tue Mar 19, 2024 8:06 am [ UTC ]