Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cryptomatte Metadata names from Blender still not fully supported #113

Closed
aliasguru opened this issue Jul 15, 2019 · 2 comments
Closed

Cryptomatte Metadata names from Blender still not fully supported #113

aliasguru opened this issue Jul 15, 2019 · 2 comments

Comments

@aliasguru
Copy link
Contributor

aliasguru commented Jul 15, 2019

Hi there,

This is a follow-up ticket on the Metadata naming issue. Basically, when Nuke imports the Layers, it replaces certain characters with an underscore, but does not update the metadata that comes with it. This is known and handled partially in the other report.

The problem is that Nuke replaces much more than just dots. Actually it seems that only alphanumeric digits plus underscores and dashes are ok. The fact that the default view layer name in Blender is View Layer, which Nuke turns into View_Layer, doesn't exactly help. To fix this, I suggest changing the def _legal_nuke_layer_name to the code below:

def _legal_nuke_layer_name(name):
    """ Blender produces channels with certain characters in the name, which Nuke 
    changes to "_". We have to make sure we handle Cryptomattes
    that are built this way. Doing this by only allowing alphanumeric
    output plus dash and underscores
    """
    return "".join([x if x.lower() in 'abcdefghijklmnopqrstuvwxyz1234567890_-' else '_' for x in name])

This reverses the logic. Instead of stripping out illegal characters, it allows the legal ones. We tested this internally and it proved to work for our cases.

@aliasguru
Copy link
Contributor Author

I have opened a pull request for easier merge

@jonahfriedman
Copy link
Contributor

Thanks for that, @aliasguru. Sorry it's taken so long to get to this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants