asset

Implementation of jukeboxcore.reftrack.ReftypeInterface for Assets.

jukeboxmaya.reftrack.asset.select_dp_nodes(reftrack)[source]

Select all dag nodes of the given reftrack

Parameters:reftrack (jukeboxcore.reftrack.Reftrack) – The reftrack to select the dagnodes for
Returns:None
Return type:None
Raises:None
jukeboxmaya.reftrack.asset.select_dag_nodes(reftrack)[source]

Select all dag nodes of the given reftrack

Parameters:reftrack (jukeboxcore.reftrack.Reftrack) – The reftrack to select the dagnodes for
Returns:None
Return type:None
Raises:None
class jukeboxmaya.reftrack.asset.AssetReftypeInterface(refobjinter)[source]

Bases: jukeboxcore.reftrack.ReftypeInterface

Interface for handling the content of released assets in the reference workflow.

Initialize a new AssetReftypeInterface that uses the given RefobjInterface

Parameters:refobjinter (jukeboxmaya.refobjinter.MayaRefobjInterface) – the interface to handle the reftrack nodes
Raises:None
is_replaceable(refobj)[source]

Return whether the given reference of the refobject is replaceable or if it should just get deleted and loaded again.

Returns True, because Maya can replace references.

Parameters:refobj (refobj) – the refobject to query
Returns:True, if replaceable
Return type:bool
Raises:NotImplementedError
get_scenenode(nodes)[source]

Get the scenenode in the given nodes

There should only be one scenenode in nodes!

Parameters:nodes
Returns:None
Return type:None
Raises:AssertionError
reference(refobj, taskfileinfo)[source]

Reference the given taskfileinfo into the scene and return the created reference node

The created reference node will be used on RefobjInterface.set_reference() to set the reference on a reftrack node. Do not call RefobjInterface.set_reference() yourself.

This will also create a group node and group all dagnodes under a appropriate node.

Parameters:
  • refobj (str) – the reftrack node that will be linked to the reference
  • taskfileinfo (jukeboxcore.filesys.TaskFileInfo) – The taskfileinfo that holds the information for what to reference
Returns:

the reference node that was created and should set on the appropriate reftrack node

Return type:

str

Raises:

None

load(refobj, reference)[source]

Load the given reference

Load in this case means, that a reference is already in the scene but it is not in a loaded state. Loading the reference means, that the actual data will be read.

Parameters:
  • refobj (str) – the reftrack node that is linked to the reference
  • reference – the reference node
Returns:

None

Return type:

None

Raises:

None

unload(refobj, reference)[source]

Unload the given reference

Unload in this case means, that a reference is stays in the scene but it is not in a loaded state. So there is a reference, but data is not read from it.

Parameters:
  • refobj – the refobj that is linked to the reference
  • reference – the reference object. E.g. in Maya a reference node
Returns:

None

Return type:

None

Raises:

None

replace(refobj, reference, taskfileinfo)[source]

Replace the given reference with the given taskfileinfo

Parameters:
  • refobj – the refobj that is linked to the reference
  • reference – the reference object. E.g. in Maya a reference node
  • taskfileinfo (jukeboxcore.filesys.TaskFileInfo) – the taskfileinfo that will replace the old entity
Returns:

None

Return type:

None

Raises:

None

delete(refobj)[source]

Delete the content of the given refobj

Parameters:refobj (refobj) – the refobj that represents the content that should be deleted
Returns:None
Return type:None
Raises:None
import_reference(refobj, reference)[source]

Import the given reference

The reference of the refobj will be set to None automatically afterwards with RefobjInterface.set_reference()

Parameters:
  • refobj – the refobj that is linked to the reference
  • reference – the reference object. E.g. in Maya a reference node
Returns:

None

Return type:

None

Raises:

None

import_taskfile(refobj, taskfileinfo)[source]

Import the given taskfileinfo and update the refobj

Parameters:
Returns:

None

Return type:

None

Raises:

None

fetch_option_taskfileinfos(element)[source]

Fetch the options for possible files to load, replace etc for the given element.

Options from which to choose a file to load or replace.

Parameters:element (jukeboxcore.djadapter.models.Asset | jukeboxcore.djadapter.models.Shot) – The element for which the options should be fetched.
Returns:The options
Return type:list of TaskFileInfo
Raises:None
create_options_model(taskfileinfos)[source]

Create a new treemodel that has the taskfileinfos as internal_data of the leaves.

I recommend using jukeboxcore.gui.filesysitemdata.TaskFileInfoItemData for the leaves. So a valid root item would be something like:

rootdata = jukeboxcore.gui.treemodel.ListItemData(["Asset/Shot", "Task", "Descriptor", "Version", "Releasetype"])
rootitem = jukeboxcore.gui.treemodel.TreeItem(rootdata)
Returns:the option model with TaskFileInfo as internal_data of the leaves.
Return type:jukeboxcore.gui.treemodel.TreeModel
Raises:None
get_option_labels(element)[source]

Return labels for each level of the option model.

The options returned by RefobjInterface.fetch_options() is a treemodel with n levels. Each level should get a label to describe what is displays.

Assets are organized in tasks and versions.

Parameters:element (jukeboxcore.djadapter.models.Asset | jukeboxcore.djadapter.models.Shot) – The element for which the options should be fetched.
Returns:label strings for all levels
Return type:list
Raises:None
get_option_columns(element)[source]

Return the column of the model to show for each level

Because each level might be displayed in a combobox. So you might want to provide the column to show.

Parameters:element (jukeboxcore.djadapter.models.Asset | jukeboxcore.djadapter.models.Shot) – The element for wich the options should be fetched.
Returns:a list of columns
Return type:list
Raises:None
get_suggestions(reftrack)[source]

Return a list with possible children for this reftrack

Each Reftrack may want different children. E.g. a Asset wants to suggest a shader for itself and all assets that are linked in to it in the database. Suggestions only apply for enities with status other than None.

A suggestion is a tuple of typ and element. It will be used to create a newlen Reftrack. The parent will be this instance, root and interface will of course be the same.

This will delegate the call to the appropriate ReftypeInterface. So suggestions may vary for every typ and might depend on the status of the reftrack.

Parameters:reftrack (Reftrack) – the reftrack which needs suggestions
Returns:list of suggestions, tuples of type and element.
Return type:list
Raises:None
get_scene_suggestions(current)[source]

Return a list with elements for reftracks for the current scene with this type.

For every element returned, the reftrack system will create a Reftrack with the type of this interface, if it is not already in the scene.

E.g. if you have a type that references whole scenes, you might suggest all linked assets for shots, and all liked assets plus the current element itself for assets. If you have a type like shader, that usually need a parent, you would return an empty list. Cameras might only make sense for shots and not for assets etc.

Do not confuse this with ReftypeInterface.get_suggestions(). It will gather suggestions for children of a Reftrack.

The standard implementation only returns an empty list!

Parameters:reftrack (Reftrack) – the reftrack which needs suggestions
Returns:list of suggestions, tuples of type and element.
Return type:list
Raises:None
is_available_for_scene(element)[source]

Return True, if it should be possible to add a new reftrack with the given element and the type of the interface to the scene.

Some types might only make sense for a shot or asset. Others should never be available, because you would only use them as children of other reftracks (e.g. a shader).

Parameters:element (jukeboxcore.djadapter.models.Asset | jukeboxcore.djadapter.models.Shot) – the element that could be used in conjuction with the returned types to create new reftracks.
Returns:True, if available
Return type:bool
Raises:None
get_typ_icon()[source]

Return a icon that should be used to identify the type in an UI

Returns:a icon for this type
Return type:QtGui.QIcon | None
Raises:None
get_additional_actions(reftrack)[source]

Return a list of additional actions you want to provide for the menu of the reftrack.

E.e. you want to have a menu entry, that will select the entity in your programm.

Parameters:reftrack (Reftrack) – the reftrack to return the actions for
Returns:A list of ReftrackAction
Return type:list
Raises:None