Hello guys
So to do what I really wanted to do it wasn’t that hard but it wasn’t obvious either. We wanted the following behavior mainly for the needs of a particular show so bare with me… I am only posting this because it might be interesting for others in the future.
I wanted to fully override how the publisher2 handles mov files inside Maya. I wanted to fully override the fact that you can drag & drop files on the publisher except MOV files but at the same time I wanted the dropped mov file to be linked to the Maya session when publishing…
Somthing like this:
If you drag & drop any other type of file, the publisher will reject it. Now the Mov file that gets published get renamed so it doesn’t necessarily need to have a work template on the template.yml.
Some details.
-
First created two new settings on the template.yml (on maya asset and shot context)
-
Secondly, fully remove the default inheritance of the publisher collector for Maya by a replica of the original one but that will accepts MOV files. I removed the default (single) {self}/publish_file.py because I am inheriting from it on the publish_movie.py file so leaving the independent one would want to publish twice the MOV file
-
Thirdly the movie_collector.py
-
Lastly the publish_movie.py validate function.
By the way, the reason why the movie publisher is still checking things of the Maya session is that I use the work template from that part to be able to rename the mov file in the publish. I could probably directly get the name of the Maya file from the publisher rather than imitating the Maya session python file logic.
Anyway this is probably not the most efficient way of doing something like this and again this was needed inside our project so I highly doubt it could be used by others. I just found interesting how flexible the publisher is and how customizable it can be. The only flaw is the fact that to implement something like this you need to edit so many different files so if this isn’t something you handle quite often it can be pretty confusing.
Cheers