tokejepsen Posted May 8, 2017 Report Posted May 8, 2017 Hey, We have had a lot of issues with the consistency of prompting users in Nuke when there are new asset versions available. It seems to usually be when you launch Nuke, that the prompt does not appear. If you have launched Nuke and open another comp, it seems to prompt the user correctly. I'm wondering whether the callback "onScriptLoad" is not being execute when you launch Nuke and pass a nuke script to the Nuke executable.
Mattias Lagergren Posted May 8, 2017 Report Posted May 8, 2017 Hi Toke, thank your for bringing up this. Quote I'm wondering whether the callback "onScriptLoad" is not being execute when you launch Nuke and pass a nuke script to the Nuke executable. Are you launching Nuke manually with the ftrack plugin + a script as a launch argument?
tokejepsen Posted May 8, 2017 Author Report Posted May 8, 2017 3 hours ago, Mattias Lagergren said: Are you launching Nuke manually with the ftrack plugin + a script as a launch argument? Yes, I'm passing the Nuke executable a script, with the launch arguments.
Mattias Lagergren Posted May 9, 2017 Report Posted May 9, 2017 Interesting, thanks for notifying us. I will check and see if I can reproduce the issue
lorenzo.angeli Posted May 11, 2017 Report Posted May 11, 2017 Hi @Toke Jepsen I'm currently looking into this issue. Could you please provide the snippet you are using in your custom hook to load the nuke file ? Thanks. L.
tokejepsen Posted May 11, 2017 Author Report Posted May 11, 2017 44 minutes ago, lorenzo.angeli said: Hi @Toke Jepsen I'm currently looking into this issue. Could you please provide the snippet you are using in your custom hook to load the nuke file ? Thanks. L. Hey Lorenzo, Its passing a file to the Nuke executable by modifying the command of the Nuke hook. It basically gets boiled down to this: import ftrack def modify_application_launch(event): """Modify the application launch command with potential files to open""" data = event["data"] data["command"].append("path/to/nuke/script") return data def register(registry, **kw): """Register location plugin.""" # Validate that registry is the correct ftrack.Registry. If not, # assume that register is being called with another purpose or from a # new or incompatible API and return without doing anything. if registry is not ftrack.EVENT_HANDLERS: # Exit to avoid registering this plugin again. return ftrack.EVENT_HUB.subscribe( "topic=ftrack.connect.application.launch", modify_application_launch ) EDIT: Updated with reduce code example.
lorenzo.angeli Posted May 11, 2017 Report Posted May 11, 2017 cheers. I was checking now passing launchArguments to the nuke hook but couldn't get to make it work. L.
lorenzo.angeli Posted May 11, 2017 Report Posted May 11, 2017 Hi @tokejepsen found a workaround for now, see whether does work for you. # in your hook def get_task_data(event): cwd = os.path.dirname(__file__) data = event["data"] data["command"].append(os.path.join(cwd, 'fileload.py')) return data # in the same folder in a file called fileload.py from ftrack_connect_nuke.ui.legacy import scan_for_new_assets import nuke nuke.addOnScriptLoad(scan_for_new_assets) nuke.scriptOpen('/home/efesto/Desktop/<myfile>.nk') I'll keep checking for a better solution but I'm not sure whether this is a nuke or an ftrack issue. Please let me know if this does work for the time being. L.
tokejepsen Posted May 12, 2017 Author Report Posted May 12, 2017 Hey @lorenzo.angeli I figured out a simpler solution for our pipeline, I don't why it doesn't work for ftrack-connect-nuke. All I'm doing is calling a method that sets the callbacks; https://github.com/bumpybox/pyblish-bumpybox/blob/master/pyblish_bumpybox/environment_variables/nuke_path/menu.py#L29 https://github.com/bumpybox/pyblish-bumpybox/blob/master/pyblish_bumpybox/environment_variables/nuke_path/ftrack_init.py#L143
Recommended Posts
Archived
This topic is now archived and is closed to further replies.