Jump to content

Lucidity: How to deal with spaces in object types?


Mike

Recommended Posts

So I'm starting to build out my custom folder structure using Lucidity.  I have a recursive function that creates data dictionary chunks for each folder path and stores them in a list to be iterated over (much like in the create folders example hook).  This is working great, but I'm running into issues with asset builds.  

When I try to get the object type of an asset build using this:

item_type = item['object_type']['name'].lower()

It returns a string: 'asset build'

This is causing an issue with the Lucidity templates because they don't like spaces apparently. 

So when I'm creating my data dictionary chunk:

templates_dict[item_type] = {'name': item['name']}

And go to format the data:

defregister_templates(self):='{project.name}/{folder.name}/3D/{asset build.name}/Production/{task.name}'
    returnTemplate('asset-maya',.join([,'Maya']))

I get an error that says 'Placeholder name contains invalid characters'

If I do something like this:

if item_type == 'asset build':
    item_type = 'assetbuild'

It fixes the problem, is this an acceptable solution?

Link to comment
Share on other sites

For reference, the reason spaces are not supported for placeholders is because Lucidity uses the Python stdlib re module under the hood which also has this limitation.

>>> re.compile("(?P<some group>.+)")
error: bad character in group name 'some group'

However, it should be possible to work around in Lucidity core if it is an issue for you folks. Just create a feature request at https://github.com/4degrees/lucidity/issues

 

 

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...