refobjinter¶
Implementation of jukeboxcore.reftrack.RefobjInterface for Maya.
We depend heavily on the JB_ReftrackNode. It is used as the refobject. These nodes can be connected to signal a parent child relationship. Via a connection to a scenenode/reference node we can query the needed informations.
- class jukeboxmaya.reftrack.refobjinter.MayaRefobjInterface[source]¶
Bases: jukeboxcore.reftrack.RefobjInterface
Interface to interact mainly with the JB_ReftrackNode.
To interact with the content of each entity, there is a special reftyp interface that is not only software specific but also handles only a certain type of entity. You can register additional type interfaces, so plugins can introduce their own entity types. See MayaRefobjInterface.types. When subclassing you could replace it in your class with a dictionary of MayaReftypeInterface. Or you can call MayaRefobjInterface.register_type() at runtime. A type could be “Asset”, “Alembic”, “Camera” etc.
Initialize a new refobjinterface.
Raises: None - types = {'Asset': <class 'jukeboxmaya.reftrack.asset.AssetReftypeInterface'>}¶
A dictionary that maps types of entities (strings) to the reftypinterface class
- exists(refobj)[source]¶
Check if the given JB_ReftrackNode is still in the scene or if it has been deleted/dissapeared
Parameters: refobj (str) – a reftrack node to query Returns: True, if it still exists Return type: bool Raises: None
- get_parent(refobj)[source]¶
Return the parent of the given JB_ReftrackNode.
Parameters: refobj (str) – a reftrack node to query Returns: the parent reftrack node Return type: refobj | None Raises: None
- set_parent(child, parent)[source]¶
Set the parent of the child reftrack node
Parameters: Returns: None
Return type: None
Raises: None
- get_children(refobj)[source]¶
Get the children reftrack nodes of the given node
It is the reverse query of RefobjInterface.get_parent()
Parameters: refobj (str) – the parent reftrack node Returns: a list with children reftrack nodes Return type: list Raises: None
- get_typ(refobj)[source]¶
Return the entity type of the given reftrack node
See: MayaRefobjInterface.types.
Parameters: refobj (str) – the reftrack node to query Returns: the entity type Return type: str Raises: ValueError
- set_typ(refobj, typ)[source]¶
Set the type of the given refobj
Parameters: - refobj (refobj) – the reftrack node to edit
- typ (str) – the entity type
Returns: None
Return type: None
Raises: ValueError
- get_id(refobj)[source]¶
Return the identifier of the given refobject
Parameters: refobj (refobj) – the refobj to query Returns: the refobj id. Used to identify refobjects of the same parent, element and type in the UI Return type: int Raises: None
- set_id(refobj, identifier)[source]¶
Set the identifier on the given refobj
Parameters: - refobj (refobj) – the refobj to edit
- identifier (int) – the refobj id. Used to identify refobjects of the same parent, element and type in the UI
Returns: None
Return type: None
Raises: None
- create_refobj()[source]¶
Create and return a new reftrack node
Returns: the new reftrack node Return type: str Raises: None
- referenced_by(refobj)[source]¶
Return the reference that holds the given reftrack node.
Returns None if it is imported/in the current scene.
Parameters: refobj (str) – the reftrack node to query Returns: the reference node that holds the given refobj Return type: str | None Raises: None
- delete(refobj)[source]¶
Delete the given refobj and the contents of the entity
Parameters: refobj (refobj) – the refobj to delete Returns: None Return type: None Raises: None
- delete_refobj(refobj)[source]¶
Delete the given reftrack node
Parameters: refobj (str) – the node to delete Returns: None Return type: None Raises: None
- get_all_refobjs()[source]¶
Return all refobjs in the scene
Returns: all refobjs in the scene Return type: list Raises: None
- get_current_element()[source]¶
Return the currently open Shot or Asset
Returns: the currently open element Return type: jukeboxcore.djadapter.models.Asset | jukeboxcore.djadapter.models.Shot | None Raises: djadapter.models.TaskFile.DoesNotExist
- set_reference(refobj, reference)[source]¶
Connect the given reftrack node with the given refernce node
Parameters: Returns: None
Return type: None
Raises: None
- get_reference(refobj)[source]¶
Return the reference node that the reftrack node is connected to or None if it is imported.
Parameters: refobj (str) – the reftrack node to query Returns: the reference node Return type: str | None Raises: None
- get_status(refobj)[source]¶
Return the status of the given reftrack node
See: Reftrack.LOADED, Reftrack.UNLOADED, Reftrack.IMPORTED.
Parameters: refobj (str) – the reftrack node to query Returns: the status of the given reftrack node Return type: str Raises: None
- get_taskfile(refobj)[source]¶
Return the taskfile that is loaded and represented by the refobj
Parameters: refobj (str) – the reftrack node to query Returns: The taskfile that is loaded in the scene Return type: jukeboxcore.djadapter.TaskFile Raises: None
- connect_reftrack_scenenode(refobj, scenenode)[source]¶
Connect the given reftrack node with the given scene node
Parameters: Returns: None
Return type: None
Raises: None
- fetch_action_restriction(reftrack, action)[source]¶
Return wheter the given action is restricted for the given reftrack
available actions are:
reference, load, unload, replace, import_reference, import_taskfile, deleteIf action is not available, True is returned.
Replace and Delete is always restricted for nested references!
Parameters: - reftrack (Reftrack) – the reftrack to query
- action (str) – the action to check.
Returns: True, if the action is restricted
Return type: Raises: None