Are non-modal windows possible

Forum for OctaneRender Lua scripting examples, discussion and support.
Post Reply
abzivid
Licensed Customer
Posts: 15
Joined: Thu Sep 30, 2021 9:11 am

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
Posts: 15
Joined: Thu Sep 30, 2021 9:11 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
Post Reply

Return to “Lua Scripting”