Hi, I need some help with Lua scripting.
It is possible to get the command line args that were passed to the Octane process? And then update some (camera) node in the loaded project with them? The problem is that the camera cmdline args are saved to some default camera, that is used when you click on a geometry node, but I'd need those parameters to be saved in some Render Target camera (or arbitrary camera node the user specifies).
Or if it's not possible to know the cmdline args, it is possible to read that "default" camera which receives them on project load?
Read camera cmdline params and applying them to a cam node
nvm I got this.
I'd still like to know if it's possible to get (with Lua) the cmd line args that were passed to Octane process?
I'd still like to know if it's possible to get (with Lua) the cmd line args that were passed to Octane process?
SW: Octane 3.05 | Linux Mint 18.1 64bit | Blender 2.78 HW: EVGA GTX 1070 | i5 2500K | 16GB RAM Drivers: 375.26
cgmo.net
cgmo.net
Usually when you open in the built-in editor it will echo the command it the status bar as the script is being ran
Win 11 64GB | NVIDIA RTX3060 12GB
What I'm interested in is to programatically read the command line arguments Octane was started with. I already solved my problem differently, but having this info available to you through Lua, might be a useful thing for future automation tasks.Tugpsx wrote:Usually when you open in the built-in editor it will echo the command it the status bar as the script is being ran
SW: Octane 3.05 | Linux Mint 18.1 64bit | Blender 2.78 HW: EVGA GTX 1070 | i5 2500K | 16GB RAM Drivers: 375.26
cgmo.net
cgmo.net
- stratified
- Posts: 945
- Joined: Wed Aug 15, 2012 6:32 am
- Location: Auckland, New Zealand
You can do this partially. You can't read the normal command line arguments but you can pass a string argument to the script from the command line. These arguments are available in the global variablematej wrote:What I'm interested in is to programatically read the command line arguments Octane was started with. I already solved my problem differently, but having this info available to you through Lua, might be a useful thing for future automation tasks.Tugpsx wrote:Usually when you open in the built-in editor it will echo the command it the status bar as the script is being ran
arg
with arg[0] being the program. For example:Code: Select all
./octane --script ~/dev/lua/command-line-args.lua --script-args "this is passed verbatim to lua" --stop-after-script
Code: Select all
-- print out the command line args
for i=0,#arg do
print(string.format("arg%d : %s", i, arg[i]))
end
cheers,
Thomas
I see. After thinking it through a little more, reading cmd line args. isnt that useful, because you can pass data only for one camera, one resolution, one imager, one frame basically... It's much more flexible & powerfull to save everything you need in a Lua script - that is in my case generated from Blender and then run on Octane start.stratified wrote:You can do this partially. You can't read the normal command line arguments but you can pass a string argument to the script from the command line.
Thanks for your help!
SW: Octane 3.05 | Linux Mint 18.1 64bit | Blender 2.78 HW: EVGA GTX 1070 | i5 2500K | 16GB RAM Drivers: 375.26
cgmo.net
cgmo.net
- stratified
- Posts: 945
- Joined: Wed Aug 15, 2012 6:32 am
- Location: Auckland, New Zealand
Sure, it's more powerful. Of course it's more cumbersome as well because Octane just passes the string verbatim. It's up to the script to fully fledge out the command line arguments.matej wrote:I see. After thinking it through a little more, reading cmd line args. isnt that useful, because you can pass data only for one camera, one resolution, one imager, one frame basically... It's much more flexible & powerfull to save everything you need in a Lua script - that is in my case generated from Blender and then run on Octane start.stratified wrote:You can do this partially. You can't read the normal command line arguments but you can pass a string argument to the script from the command line.
Thanks for your help!
cheers,
Thomas