obj loader script

Forums: obj loader script
Forum for OctaneRender Lua scripting examples, discussion and support.

Re: obj loader script

Postby Tugpsx » Mon Jan 06, 2014 5:20 am

Tugpsx Mon Jan 06, 2014 5:20 am
stratified wrote:
Tugpsx wrote:Nice update, maybe you could also add an option to store last path used octane.project.getCurrentProject or something like that.
Thanks for sharing.


not sure what you mean, octane.project.getCurrentProject() already exists in the API.

cheers,
Thomas


Correct, I was asking if there was a way to have the script remember the last path/location used and since I noticed there was an option in the API doc posted it as a reference/hint.
Dell Win Vista 32 | NVIDIA Quadro NVS135M | Core2 Duo T7500 2.20GHz | 4GB
CyberPowerPC Win 7 64| NVIDIA GTX660Ti (3G) GTX480(1.5G) | 16GB
Tugpsx
Licensed Customer
Licensed Customer
 
Posts: 1145
Joined: Thu Feb 04, 2010 8:04 pm
Location: Chicago, IL

Re: obj loader script

Postby stratified » Mon Jan 06, 2014 5:57 am

stratified Mon Jan 06, 2014 5:57 am
Okay, sorry for the confusion on my side.

The last location isn't remembered, so you have to store it in the script. You can then use this location in the field path of the properties used in showDialog. That way you always open the file chooser in the last location.

Does this solve your problem?

cheers,
Thomas
User avatar
stratified
OctaneRender Team
OctaneRender Team
 
Posts: 945
Joined: Wed Aug 15, 2012 6:32 am
Location: Auckland, New Zealand

Re: obj loader script

Postby Tugpsx » Mon Jan 06, 2014 7:05 am

Tugpsx Mon Jan 06, 2014 7:05 am
Yes that would be the idea. I think most users may only run this script occasionally but some of us have directories where all our projects are stored and it would be great if it remembers its last location.
I think you gave an example in a previous script.

-- global variable that holds the output path
OUT_PATH = nil
-- choose an output file
local ret = octane.gui.showDialog
{
type = octane.gui.dialogType.FILE_DIALOG,
title = "Choose the output file",
wildcards = "*.png",
save = true,
}
-- if a file is chosen
if ret.result ~= "" then
renderButton:updateProperties{ enable = true }
fileEditor:updateProperties{ text = ret.result }
OUT_PATH = ret.result
else
renderButton:updateProperties{ enable = false }
fileEditor:updateProperties{ text = "" }
OUT_PATH = nil
end
Dell Win Vista 32 | NVIDIA Quadro NVS135M | Core2 Duo T7500 2.20GHz | 4GB
CyberPowerPC Win 7 64| NVIDIA GTX660Ti (3G) GTX480(1.5G) | 16GB
Tugpsx
Licensed Customer
Licensed Customer
 
Posts: 1145
Joined: Thu Feb 04, 2010 8:04 pm
Location: Chicago, IL

Re: obj loader script

Postby stratified » Mon Jan 06, 2014 7:45 am

stratified Mon Jan 06, 2014 7:45 am
Hi,

Unlike 1.20, Octane doesn't have allow the user the configure the project path anymore. Octane is a bit smarter now and remembers the last location for projects, textures, meshes and renders. These locations are persisted in preferences_v2 located in the app directory.

What we can do is make these directories available to do smarter stuff in scripts. Right now they aren't exposed yet. Would that help you?

BTW: could you put source code in the code tag instead of making it italic? It takes care of indentation.

cheers,
Thomas
User avatar
stratified
OctaneRender Team
OctaneRender Team
 
Posts: 945
Joined: Wed Aug 15, 2012 6:32 am
Location: Auckland, New Zealand

Re: obj loader script

Postby Tugpsx » Mon Jan 06, 2014 3:34 pm

Tugpsx Mon Jan 06, 2014 3:34 pm
Sorry for the italic. It would be great to have access to the paths via script. Some users are using sequenced obj for animation and this kind of option would be helpful with exporters.
Also the obj-loader would benefit from remembering where it was used last.
Dell Win Vista 32 | NVIDIA Quadro NVS135M | Core2 Duo T7500 2.20GHz | 4GB
CyberPowerPC Win 7 64| NVIDIA GTX660Ti (3G) GTX480(1.5G) | 16GB
Tugpsx
Licensed Customer
Licensed Customer
 
Posts: 1145
Joined: Thu Feb 04, 2010 8:04 pm
Location: Chicago, IL

Re: obj loader script

Postby stratified » Mon Jan 06, 2014 6:50 pm

stratified Mon Jan 06, 2014 6:50 pm
Ok, we'll add them in release candidate 1.25.

cheers,
Thomas
User avatar
stratified
OctaneRender Team
OctaneRender Team
 
Posts: 945
Joined: Wed Aug 15, 2012 6:32 am
Location: Auckland, New Zealand
Previous

Return to Lua Scripting


Who is online

Users browsing this forum: No registered users and 6 guests

Thu Mar 28, 2024 3:06 pm [ UTC ]