PDA

View Full Version : Can i manipulate position and size of the limited Region with LWPy



Diepgroen
03-06-2017, 05:13 PM
I've read some threads about split rendering ( which i want to automate for Octane Renders with Python) and the most promising seems to be Erikals technique (http://forums.newtek.com/showthread.php?151507-Split-render-into-chunks&p=1483303&viewfull=1#post1483303) to render-out chunks of a render using the Limited Region. As Octane also reads data from LightWave's Limited Region it will be very useful to control large print rendering with segmentation.

Can i access and control Limited Region settings like the (x, y)Position and the (width, height)Size of the Limited Region with Python? I only know how to read the position and size of the limited region but not how to change them programmatically like in the Set Limited Region UI panel.

Are they accessible ?

example
136215

ernpchan
03-06-2017, 11:03 PM
I think you can via lscript, at least that's what I believe after looking at the lscript documentation. So you'd want to call the Layout command via python.

Sensei
03-07-2017, 05:05 AM
Utilities > Cmd History
Then use Limited Region tool,
and read what command is listed in Cmd History window.. :)
Execute command from your code.
This method will work with few others things, even not documented.

Diepgroen
03-07-2017, 06:32 AM
@ernpchan

I think you can via lscript, at least that's what I believe after looking at the lscript documentation. So you'd want to call the Layout command via python.

Thanks, I finally got the information, but got lost at first. Wishing there was a simple search mechanism for the lwsdk manual. Just for future referennce I'll lay them out here.

LWSDK manual


lwsdk.command("MaskPosition nLeft ntop nwidth nheight"")
lwsdk.command("MaskColor gred ggreen gblue")
lwsdk.command("LimitedRegion") returns values 1 and 2


LWPython manual


lwsdk.LWCameraInfo().regionLimits(LWItemID camera) return (x0, y0, x1, y1)
lwsdk.LWCameraInfo().maskLimits(LWItemID camera) return (x0, y0, x1, y1)
lwsdk.LWCameraInfo().maskColor(LWItemID camera) return ( color[3])


@Sensei

Utilities > Cmd History
Then use Limited Region tool,
and read what command is listed in Cmd History window.. :)
Execute command from your code.
This method will work with few others things, even not documented.

Learned something new there!
I've been gocking at the LS Commander for some time now to look for answers. But Cmd History! Now i never looked at this before. And there it was: an undocumented command property.



lwsdk.command("RegionPosition 10 10 631 354")


Thank you guys!