Hi Joerg,

After a quick research, I've found that I've actually override the
versionScanner class because I wanted a custom one.
I've use this script as a base from the examples :
*\pythonextensions\site-packages\hiero\examples\versioning_example.py*
Which ovverride the built-in versionScanner

What you want to do is not to customise it but simply call the function
that scan for versions. VersionScanner.py contains the actual process to
retrieve the versions. ScanForVersions.py is the file that contains the
functions triggered by the right-click "scan for version" in NukeStudio.
you can find it here:
*\pythonextensions\site-packages\hiero\ui\ScanForVersions.py*

I believe you need to call the doit() method from the
class ScanForVersionsAction.
Something like hiero.ui.ScanForVersions.action.doit()

However it might not work as during the process it needs to retrieve the
currentContextMenu(), ie: the Time line editor, or bin view etc to retrieve
the selected items (This method is called from the right-click context
menu; so it always come from somewhere as the user did right-click in a
panel). If it is fully python; you probably need to override the
ScanForVersionsAction class; and provide the items versions you want to
scan, to the doit() method.

Hope that helps !

Cheers,
Justin

PS: You've posted in Nuke-user mailing list; maybe Nuke-python would have
been more appropriate.

2016-07-02 1:09 GMT+01:00 Joerg Bruemmer <j.bruem...@lostgraphics.de>:

> Hi Justin,
> thanks for your suggestions! I will have another look at VersionScanner.
> Was playing around with it yesterday , but did not get the wanted result.
> If you can find your script that would be awesome! Will do further
> investigations on Monday.
> Cheers,
> Joerg
>
> On 01/07/2016, at 21:04, Justin GD <j.grosde...@gmail.com> wrote:
>
> Hi Joerg,
>
> I remember doing something similar, but can't find my script anymore
> (should be on a hard drive at home).
>
> As you said, you need to list first all versions before performing a
> versioning operation (up, down, max etc).
> Have you had a look directly at the VersionScanner.py from Nuke ?
> (/pythonextensions/site-packages/hiero/core/)
>
> I think I did reimplement this class because I was scanning and versioning
> files with 2 versions number (v001_0001, v001_0002, v002_0004 etc ) It was
> working great so I believe it is possible this way. However there is
> probably a simpler way since your version scan is not custom.
>
> Will try to retrieve the script...
>
> Cheers,
> J
>
>
>
>
>
>
> 2016-07-01 3:56 GMT+01:00 Joerg Bruemmer <j.bruem...@lostgraphics.de>:
>
>> Hi guys,
>>
>> can someone tell me how I force a "scan for versions" on a sequence in
>> python. I am adding clips to a timeline in v01. Not all of them are there
>> or have a version 1. So after everything is build I would like to call
>> whatever the rightclick dropdown is calling. trackItem.maxVersion() does
>> not do anything. But it will work after the scan.
>> Cheers!
>> Joerg
>>
>> _______________________________________________
>> Nuke-users mailing list
>> Nuke-users@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
>> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users
>>
>
> _______________________________________________
> Nuke-users mailing list
> Nuke-users@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users
>
>
>
> _______________________________________________
> Nuke-users mailing list
> Nuke-users@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users
>
_______________________________________________
Nuke-users mailing list
Nuke-users@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users

Reply via email to