Jump to content

Location Path is Red


eight

Recommended Posts

Hi,

I'm trying to create a custom location which uses a disk path that doesn't change. I've created a script that's supposed to publish an image sequence. It runs without errors, and I can see it in ftrack (browser), but when I look at the published version path, it's red, as if there's an error. Also, if I try to import it in Nuke, it won't show up.

 

Here's the relevant code for that:

locations.pydef getLosAngeles():	locationName = "test.losangeles"	accessor = ftrack.DiskAccessor(prefix=r"V:")	structure = ftrack.OriginStructure(prefix=r"V:")	location = ftrack.ensureLocation(locationName)	location = ftrack.Location(locationName, accessor=accessor, structure=structure)	return location------------------------------------------------------------------------------------------------publish.pytry:	asset = shot.getAsset(name=assetName, assetType='comp')except:	asset = shot.createAsset(name=assetName, assetType='comp', task=task)version = asset.createVersion(taskid=task.getId())componentPath = path_extra.toNukePadding(inFile)componentPath = "{0} [{1}]".format(componentPath, frameList)location = locations.getLosAngeles()component = version.createComponent(path=componentPath, location=location)asset.publish()

And the path I'm trying to publish is: V:\PROJECTS\Eric_Tests\_WORK\BL_010\2D\comps\renders\ftrack\ftrack.%07d.exr.

I'm not clear on what the right way to do this is.

Link to comment
Share on other sites

Hi,

 

The path shows up in red in the browser because the app was unable to 'resolve' the path. For the default ftrack locations there is a built in resolver service, but for custom locations you need to run your own resolver plugin. You can see an example at http://api.ftrack.com/developing/locations/example/resolver_plugin.html. In the near future we are going to try and support running custom resolvers directly on the server for simpler management.

 

Note that in your case, the resolver is not strictly necessary as the resolved path will be the same as the original, but the app has no way of knowing this and so shows the path in red to indicate it was not resolved.

 

Regarding Nuke not importing: From your code I see you pass a prefix value to both the Accessor and Structure plugins. As the Structure plugin is an OriginStructure it will completely ignore the prefix value (and so you don't need to pass it in). Meanwhile, the Accessor will prepend the prefix value to all your stored paths (http://api.ftrack.com/developing/api_reference/index.html#ftrack.DiskAccessor.__init__), but as you are just wanting to store paths as is you can also remove that prefix value.

accessor = ftrack.DiskAccessor(prefix="")structure = ftrack.OriginStructure()

However, these changes likely won't solve your issue. To help diagnose further can you send the output of calling getFilesystemPath and getResourceIdentifier on the component:

component = version.createComponent(path=componentPath, location=location)print componentprint component.getResourceIdentifier()print component.getFilesystemPath()

By the way, you may also want to also register your location with ftrack using the plugin path (http://api.ftrack.com/using/locations/administration.html#configuring-location-plugins). Once done you can then just retrieve a location by name:

location = ftrack.Location('test.losangeles')

Martin

Link to comment
Share on other sites

Thank you for the in-depth reply. I tried all of your suggestions, unfortunately it seems that nothing has changed. The text is still red in the web interface. In Nuke I actually can't choose the correct location. It only wants to show the 3 built-in ftrack locations. Does the ftrack plugin discover new locations on its own?

Here's the code I changed:

losAngeles.py:

import ftrackdef register(registry, **kw):	locationName = "test.losangeles"	ftrack.ensureLocation(locationName)	structure = ftrack.OriginStructure()	accessor = ftrack.DiskAccessor(prefix="")	location = ftrack.Location(locationName, structure=structure, accessor=accessor)	registry.add(location)

updated code:

location = ftrack.Location("test.losangeles")component = version.createComponent(path=componentPath, location=location)print component# <component('{'container_id': None, 'name': 'main', 'filetype': '.exr', 'entityType': 'component', 'version_id': 'c79a1170-f28a-11e3-88cf-04011a8b0d01', 'padding': 7, 'system_type': 'sequence', 'entityId': 'c7b963b8-f28a-11e3-88cf-04011a8b0d01', 'id': 'c7b963b8-f28a-11e3-88cf-04011a8b0d01', 'size': 214720903}')>print component.getResourceIdentifier()# V:\PROJECTS\Eric_Tests\_WORK\BL_010\2D\comps\renders\ftrack\ftrack.%07d.exrprint component.getFilesystemPath()# V:\PROJECTS\Eric_Tests\_WORK\BL_010\2D\comps\renders\ftrack\ftrack.%07d.exrasset.publish()

For the resolver, I just copied the example in the link you gave.

I should also mention that I set the environment variables for FTRACK_LOCATION_PLUGIN_PATH and FTRACK_TOPIC_PLUGIN_PATH to the directories that these Python files are in. And I have the line ftrack.setup() in the file that does the asset publish.

Link to comment
Share on other sites

Ok. So from the print output you got we can see that the correct path is being stored and retrieved so the Location plugin is configured correctly.

 

To fix the red text in the UI you have to make sure you have a node running to process all events as described at the end of the resolver plugin example (here is the direct link). Do you have this node running already?

 

From within Nuke can you open the script editor and run the following and reply with the output:

import osimport ftrackftrack.setup()print os.environ.get('FTRACK_LOCATION_PLUGIN_PATH')print ftrack.getLocations()

How are you launching Nuke by the way?

 

 

Martin

Link to comment
Share on other sites

That solved it. The Topic processor node was what I needed. When I came across these examples in the documentation at first, I didn't realize they would be completely necessary. The documentation on Topic plugins seems pretty sparse (or maybe I'm looking in the wrong places). Is there somewhere I can read more about it?

As for Nuke. I was previously setting the environment variables in the render farm, but forgot to set it on my computer. Whoops.

Thanks for taking time to solve this for me.

 

I had another question as well, and it's related enough that starting a new thread doesn't seem necessary:

In the Locations tutorial, it says that when adding a component, files are transferred automatically. It's easy to see how this works with the example given, which just copies from one folder to another on a local hard drive. But what happens if you transfer from an office in Los Angeles to an office in New York for example? Does ftrack have something built-in that will allow this to work, or is this something that has to be done manually?

Link to comment
Share on other sites

Great! Glad to hear it is working now.

 

The handling of transfers is performed by Accessors (one to read from the source location and one to write to the target location). If you want to automate the transfer of files between offices you can have appropriate accessors configured for those locations in your session. We have a couple of built in accessors and plan to add more, but you can take a look at this tutorial for ideas on how to add your own if required.

 

Alternatively, you can copy the data yourself and set the manageData flag to False when calling addComponents to let ftrack know that the data is already there. If this is a frequent thing you can also configure your location plugin to always set manageData to False (see UnmanagedLocation).

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...