def get_snapshot_code(my, node_name, snapshot_type): '''This function gets the snapshot_code that was used to load this asset''' node_data = NodeData(node_name) snapshot_code = node_data.get_attr("%s_snapshot" % snapshot_type, "code") return snapshot_code
def set_introspect_data(my, tactic_node, snapshot): '''adds intropection data to a tactic node @params: tactic_node: the node in the maya session to add the introspection data snapshot: the snapshot from which to add the information @return NodeData object ''' #if not my.is_tactic_node(tactic_node): # raise CGAppException("Node [%s] is not a Tactic node" % tactic_node) # add the attr if it doesn't exist #my.app.add_attr(tactic_node, "tacticNodeData") # rename to tactic_<snapshot_code> snapshot_code = snapshot.get("code") new_tactic_node = "tactic_%s" % snapshot_code tactic_node = my.app.rename_node(tactic_node, new_tactic_node) assert tactic_node == new_tactic_node snapshot_code = snapshot.get('code') from pyasm.application.common import NodeData node_data = NodeData(tactic_node, my.app) node_data.create() node_data.set_attr("snapshot", "code", snapshot_code) node_data.commit() return node_data
def get_snapshot_attr(self, node_name, snapshot_type, attr): '''This function gets the snapshot_code that was used to load this asset''' node_data = NodeData(node_name) snapshot_code = node_data.get_attr("%s_snapshot" % snapshot_type, attr) return snapshot_code
def get_snapshot_attr(self, node_name, snapshot_type, attr): '''This function gets the attr of the snapshot that was used to load this asset''' node_data = NodeData(node_name) snapshot_attr = node_data.get_attr("%s_snapshot" % snapshot_type, attr) return snapshot_attr
def get_snapshot_code(my, node_name, snapshot_type): """This function gets the snapshot_code that was used to load this asset""" node_data = NodeData(node_name) snapshot_code = node_data.get_attr("%s_snapshot" % snapshot_type, "code") return snapshot_code
def is_tactic_node(my, node): return NodeData.is_tactic_node(node)
def is_tactic_node(self, node): return NodeData.is_tactic_node(node)