OK, found it, this helps: os.path.realpath()
Ron Ganbar email: ron...@gmail.com tel: +44 (0)7968 007 309 [UK] +972 (0)54 255 9765 [Israel] url: http://ronganbar.wordpress.com/ On Mon, Mar 17, 2014 at 2:36 PM, Ron Ganbar <ron...@gmail.com> wrote: > Hi Frederich, > thanks for the script. It still leaves the /../ there though. > Anybody ever tackle how to resolve this? If I try to run os.walk on a path > containing /../ it returns an error? > > Thanks > R > > > > > > Ron Ganbar > email: ron...@gmail.com > tel: +44 (0)7968 007 309 [UK] > +972 (0)54 255 9765 [Israel] > url: http://ronganbar.wordpress.com/ > > > On Mon, Mar 17, 2014 at 2:09 PM, Frederich Munch <colse...@hotmail.com>wrote: > >> I've had similar issues and found that nuke.filename isn't reliable (on >> Mac at least): >> Only resolves when 'project_directory' is set to a value >> If 'project_directory' is wrong, resolution can point to >> a non-existent file >> >> >> This gets around those issues (but might have others in relation to path >> remapping): >> >> >> def resolveNodePath(node): >> if not isinstance(node, nuke.Node): node = nuke.toNode(node) >> return node.knob('file').evaluate() >> >> >> # nuke.filename = resolveNodePath >> >> >> >> >> ------------------------------ >> From: ron...@gmail.com >> Date: Mon, 17 Mar 2014 10:23:56 +0200 >> To: nuke-python@support.thefoundry.co.uk >> Subject: [Nuke-python] Project Directory >> >> >> Hi all, >> I'm using the project directory structure for relative paths in Nuke. >> So the Project Directory text field has: [python >> {nuke.script_directory()}] >> Then I use the ./../../path/to/file/file.jpg structure. >> However, now that I run scripts that call for the file path they don't >> work as they can't resolve the path. >> Any ideas how to get the full path? Is there a function in Nuke that >> takes care of resolving the path with the Project Directory? >> >> Thanks, >> Ron Ganbar >> email: ron...@gmail.com >> tel: +44 (0)7968 007 309 [UK] >> +972 (0)54 255 9765 [Israel] >> url: http://ronganbar.wordpress.com/ >> >> _______________________________________________ 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 >> >> _______________________________________________ >> 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 >> >> >
_______________________________________________ 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