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.stratified wrote:not sure what you mean,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.octane.project.getCurrentProject()
already exists in the API.
cheers,
Thomas
obj loader script
Win 11 64GB | NVIDIA RTX3060 12GB
- stratified
- Posts: 945
- Joined: Wed Aug 15, 2012 6:32 am
- Location: Auckland, New Zealand
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
Does this solve your problem?
cheers,
Thomas
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
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
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
Win 11 64GB | NVIDIA RTX3060 12GB
- stratified
- Posts: 945
- Joined: Wed Aug 15, 2012 6:32 am
- Location: Auckland, New Zealand
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
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
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.
Also the obj-loader would benefit from remembering where it was used last.
Win 11 64GB | NVIDIA RTX3060 12GB
- stratified
- Posts: 945
- Joined: Wed Aug 15, 2012 6:32 am
- Location: Auckland, New Zealand
Ok, we'll add them in release candidate 1.25.
cheers,
Thomas
cheers,
Thomas