API Create Field

I am writing a script to ingest render log information.  I have about 60 fields of data that I need to ingest into a shotgun entity.  Is it possible to automate the creation of fields via the API.  It seems very cumbersome doing each field manually through the UI.  It would be nice to be able to pre-format the name with "sg" and camelcap the name and automatically generate the 60 text fields I need.  Any Suggestions?



2 条评论

  • 0

    I would love to have this answered! Someone please!

  • 0

    Got the answer from searching the forum. The following command is used to create a custom Field via API:

    sg.schema_field_create ('Entity Type', 'Entity Format', 'Name of The Field to be Created')


    'Entity Type' can be: 'Shot', 'Asset', 'Task' and etc etc.

    'Entity Format' is given as a string. This argument is responsible for setting up the what kind of data (text, numbers and so on) the field will be storing.

    Valid entities: * checkbox * currency * date * date_time * duration * entity * float * list * number * percent * status_list * text * timecode * url

    'Name of The Field to be Created' is just a name of the field you create. Submitted as a String.