Custom Version Field

The HTTP & Python API
Post Reply
mitchell.lotierzo
Posts: 18
Joined: December 16th, 2016, 8:16 pm

Custom Version Field

Post by mitchell.lotierzo »

So, in our studio's pipeline, we see a "version" as a combination of a "take" and "version". For example, our files are versioned as "basename_t01_v01.ext". I could write some custom code to deal with this, but was curious if there was a way to edit or add new commands to the existing API.

Thanks!

User avatar
andrew
Site Admin
Posts: 336
Joined: June 24th, 2014, 8:10 am

Re: Custom Version Field

Post by andrew »

Hi,

You can modify our existing connectors to add the take number in the filename. You'll want to look at nim_core/nim_file.py and edit the verUp() function at line 401 to inject the take number. That at least covers the back end. I'm sure you would want to also include an option the connector UI to set a take number. If you want to include that directly in the connector UI you'll want to modify the nim_core/UI.py file to append a take input. There's a couple of places you can put a take input but you might want to look at mk_verWidgets(), win_save(), win_verUp(), and win_verPub(). C4D, AfterEffects, and Photoshop use a different code base for the UI so those would need to be modified independently.

-Andrew

mitchell.lotierzo
Posts: 18
Joined: December 16th, 2016, 8:16 pm

Re: Custom Version Field

Post by mitchell.lotierzo »

Thanks for the information Andrew! I'll take a better look at the code. Is there currently a way to store custom fields in the NIM database? So, for instance, when I get a version using the API it'll return a dictionary with the "version" and "take" fields.

Thanks for all your help!
Mitch

User avatar
andrew
Site Admin
Posts: 336
Joined: June 24th, 2014, 8:10 am

Re: Custom Version Field

Post by andrew »

Yes and no.... :)

Ideally you would just add a custom field in NIM to a file and that would be returned when getting the file info. However we currently only have custom fields on Jobs, Assets, Shots, Tasks, and Timecards. We would need to add custom fields to files for you to do this, which is totally doable and a fairly quick task.

The alternative is to access the database directly and make your own columns in the files table, however the new columns won't be returned by the API. You would need to make a database call to get your custom columns. If you do this I would suggest prefixing any columns with a studio specific prefix so when we add columns in the future we don't step on anything you may create. We have a few companies that are doing this because of the level of customization they required. Email us at support@nim-labs.com and I'd be happy to walk you through your options for direct access.

If you want to sit tight on the direct database access, we're going to take a quick look at adding custom fields to files and try to squeeze it in before the next update.

Cheers,
Andrew

Post Reply