You could simply set it yourself on the fly by using os.chdir() before
running the nukescripts.create_read() (with 'start file browser from
...' unchecked in the preferences).
If os.path.abspath(os.curdir) is important to your workflow, you may
want to save it's value before running os.chdir() and restore it after
the file browser was closed.
nuke.scriptOpen() takes an argument to know what directory to open in by
default, so that's even easier, though if you don't give it an argument,
it will also look at os.curdir assuming the preference to use the last
used directory is disabled in the preferences.
I personally use environment variables to set up favorites dynamically
and use them instead of the default dir, but wrapping the above commands
(or whatever you use for popping up the file browser) to set the current
directory in python should get you what you need.
Cheers, frank
On 24/02/16 2:39 am, Schneider, Abraham wrote:
Hi there!
Since using Nuke 9, I'm just not happy how the file browser of nuke
works. No matter if I check the 'start file browser from ...' option
in the preferences or not, it just doesn’t do what I think would be
good. If I use the option, I load a script and when I want to read in
an image, the filebrowser goes to the last directory I got an image
from. But often after loading a script, this directory is in a
different shot, not the one that belongs to my actual shot. If I
deselect the option, Nuke goes to the installation folder of my Nuke
exe on my Windows C: drive, which makes no sense either.
What I’d really like to have:
- Open a script in Nuke 9, which may be in this location:
/server/project/shot/nuke/mynukescript.nk
- create a Read node and the file browser defaults to:
/server/project/shot/
Is there any chance to set the 'actual directory' for the image/geo
file browser with python or TCL after loading a script, vor example
with an event or something?
Thanks, Abraham
*Abraham Schneider* Head of VFX pipeline / VFX Supervisor ARRI Media
GmbH Türkenstr. 89, 80799 München Phone +49 89 3809-1096 EMail
aschnei...@arri.de www.arri.de/arrimedia
<http://www.facebook.com/arrimedia> Click here
<http://www.facebook.com/arrimedia> to visit us on Facebook!
________________________________
[http://www.arri.com/media/sign/arriwebgate_media_2016_sign.jpg]
<http://www.arriwebgate.com> Get all the latest information from
www.arri.de/arrimedia<http://www.arri.de/arrimedia>,
Facebook<https://www.facebook.com/arrimedia> ARRI Media GmbH Sitz:
München - Registergericht: Amtsgericht München Handelsregisternummer:
HRB 69396 Geschäftsführer: Franz Kraus; Dr. Jörg Pohlman; Josef Reidinger
_______________________________________________
Nuke-python mailing list
Nuke-python@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python
--
ohufxLogo 50x50 <http://www.ohufx.com>
*vfx for storytellers <http://www.ohufx.com>*
*vfx compositing <http://ohufx.com/index.php/vfx-compositing> |
*workflow customisation & consulting
<http://ohufx.com/index.php/vfx-customising>**
*W E L L I N G T O N | N E W Z E A L A N D *
_______________________________________________
Nuke-python mailing list
Nuke-python@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python