Is it possible to script octane renderer to load a .obj file and display the result?
I'd be very interested in knowing if this can be done.
Loading obj through scripts
- stratified
- Posts: 945
- Joined: Wed Aug 15, 2012 6:32 am
- Location: Auckland, New Zealand
Hi,
Sure that's possible. For example with this script:
cheers,
Thomas
Sure that's possible. For example with this script:
Code: Select all
-- create mesh node and load obj file
mesh = octane.node.create{ type = octane.NT_GEO_MESH, name = "loaded mesh" }
mesh:setAttribute(octane.A_FILENAME, "/home/thomas/Documents/obj-files/cube.obj")
-- create render target and connect with mesh
rt = octane.node.create{ type = octane.NT_RENDERTARGET, name = "OBJ render" }
rt:connectTo(octane.P_MESH, mesh)
-- render
octane.render.start{ renderTargetNode = rt }
Thomas
Cool, thanks!
Just to know: is it also possible to "move the camera away"? I can render my sample obj cube but it's too close to the camera.
I'm a newbie so I'm not sure how this can be accomplished. I tried searching for "Scale of view" in the scripting LUA API but couldn't find anything
Just to know: is it also possible to "move the camera away"? I can render my sample obj cube but it's too close to the camera.
I'm a newbie so I'm not sure how this can be accomplished. I tried searching for "Scale of view" in the scripting LUA API but couldn't find anything
- p3taoctane
- Posts: 1418
- Joined: Mon Jan 25, 2010 12:53 am
This has a lot of potential...
I could not Lua my way out of a wet paper bag.... but seeing this makes me ask...
Is it possible set up a Lua script to load a series of sequentially named OBJs and shatter nodes so that they replace the obj/scatter node currently loaded called mesh_xxxx.01/ scatterxxxx.01 etc so that if
xxx.01 is all rigged up to a render node set to 5000 samples
That it renders out the image saves it with a sequential name and loads the next OBJ/scatter and rinse and repeat???
I have a bunch of scatter nodes that change over time and describe the location of an OBJ that slightly morphs over time but has the same number and named materials. I could load and replace each one and save the file...
But could lua save me the agony??
Thanks
Peter
I could not Lua my way out of a wet paper bag.... but seeing this makes me ask...
Is it possible set up a Lua script to load a series of sequentially named OBJs and shatter nodes so that they replace the obj/scatter node currently loaded called mesh_xxxx.01/ scatterxxxx.01 etc so that if
xxx.01 is all rigged up to a render node set to 5000 samples
That it renders out the image saves it with a sequential name and loads the next OBJ/scatter and rinse and repeat???
I have a bunch of scatter nodes that change over time and describe the location of an OBJ that slightly morphs over time but has the same number and named materials. I could load and replace each one and save the file...
But could lua save me the agony??
Thanks
Peter
Windows 7 Pro_SP 1_64 bit_48 GB Ram_Intel Xeon X5660 2.80 GHZ x2_6 580GTX_1 Quadra 4800
Hi Peter,
sure, with Lua you can do what you asking for and much more, like create a specific material and assign it to the mesh or part of it, deeply define the various rt options and so on
I'm a newbie in Lua and basically I cut and paste parts of devs code here and there with lot of tries and errors, but it's quite easy to understand when you dirt your hands with it
ciao beppe
sure, with Lua you can do what you asking for and much more, like create a specific material and assign it to the mesh or part of it, deeply define the various rt options and so on

I'm a newbie in Lua and basically I cut and paste parts of devs code here and there with lot of tries and errors, but it's quite easy to understand when you dirt your hands with it

ciao beppe
- p3taoctane
- Posts: 1418
- Joined: Mon Jan 25, 2010 12:53 am
Thanks man... I'll give it a shot
Peter

Peter
Windows 7 Pro_SP 1_64 bit_48 GB Ram_Intel Xeon X5660 2.80 GHZ x2_6 580GTX_1 Quadra 4800