Search the Community
Showing results for tags 'create'.
Found 4 results
Hello, My Question is: How can I create new entity types using the python api. when i create an new session object with the python api using: session = ftrack_api.Session(server_url=server_url, api_key=api_key, api_user=api_user) I can query all types using: session_types = session.types Now i am checking if all entity types our pipeline requires are present in this session using something like: session_types.get(required_entity) However if the expected entity types are NOT present -> meaning FTrack is not yet configured in the way the it needs to be for the pipeline. I want to create the missing entity types using the python api. In the GUI I would simply create new objects for each missing entity type like this: And then I would create a schema using the required objects / (entity types) and make sure that the projects are always using this schema: But I am having trouble to understand the correct way of doing so using the python api. As far as I understand the entity types are generated dynamically at the beginning of a session. The "StandardFactory" class takes care of it by creating the types specified in the existing "ProjectSchema" 's Workflow like so ? Create a new ProjectSchema? While doing so I pass in the new Entity Types I want to have created with this schema? But how can I define those new entity types? Some informatison from the docs I collected so far: " When a Session is constructed it fetches schema details from the connected server and then calls an Entity factory to create classes from those schemas. It does this by emitting a synchronous event, ftrack.api.session.construct entity-type, for each schema and expecting a class object to be returned. " http://ftrack-python-api.rtd.ftrack.com/en/stable/working_with_entities.html#customising-entity-types Regarding working with Project Schema's I only found these small snippets from the docs which do NOT show how to create a new schema: http://ftrack-python-api.rtd.ftrack.com/en/stable/example/project.html?highlight=schemas The information provided in the "Working with entities - Customising entity types" also links to this page "Understanding sessions - Configuring plugins" and the provided python file "cunstruct_entity_type.py" shows how to register a plugin but does not show how to actually create a new entity type. I hope someone can point me to the right direction! Thank you in advance, Lukas
Hey there, and our journey continues.. during the setup of a project, we want the api to automatically create milestones which have the desired assignees and status. We found out how to create milestones and set assignees, by looking at the properties, that get set, when creating a milestone via the web-interface. But with the status, this approach doesn't work for us.. Does a status-object need a state-object to be set? And for connecting it to a milestone, do we need to add the milestone as a task to its tasks-list? Or is there a simpler way to set a status for a milestone? thanks alot in advance Tim
- I'm trying to get the create folder example working in my current project, but I'm getting this error: register() takes no arguments (1 given) - I know that when the register() method is defined it should be written like this: def register(self ): etc... - However, there doesn't seem to be a register method being declared within the CreateFoldersAction class. Does this method get inherited from ftrack.Action? -Also, I haven't made any changes to the code and I've set up my hierarchy like so: Thanks!