Page 2 of 2

Re: obj loader script

PostPosted: Mon Jan 06, 2014 5:20 am
by Tugpsx
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.

Re: obj loader script

PostPosted: Mon Jan 06, 2014 5:57 am
by stratified
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

Re: obj loader script

PostPosted: Mon Jan 06, 2014 7:05 am
by Tugpsx
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

Re: obj loader script

PostPosted: Mon Jan 06, 2014 7:45 am
by stratified
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

Re: obj loader script

PostPosted: Mon Jan 06, 2014 3:34 pm
by Tugpsx
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.

Re: obj loader script

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

cheers,
Thomas