-
Notifications
You must be signed in to change notification settings - Fork 23
Nuke Examples
Daniele Federico edited this page Sep 7, 2018
·
2 revisions
from kiko import initialize
initialize()
import tempfile
import nuke
from kiko.apps.nuke import manager
from kiko.constants import KB_FILE_EXTENSION
manager = manager.NukeKikoManager()
kb_file = tempfile.mkstemp(suffix=KB_FILE_EXTENSION)
# this will export the selected objects
node = nuke.toNode("Axis1")
node.setSelected(True)
manager.export_to_file(kb_file )
# import the kb file trying to find the objects with the same name as the ones originally exported
manager.import_from_file(kb_file, ignore_item_chunks=True)
import tempfile
from maya import cmds
from kiko.apps.nuke import manager
from kiko.constants import KB_FILE_EXTENSION
manager = manager.NukeKikoManager()
kb_file = tempfile.mkstemp(suffix=KB_FILE_EXTENSION)
# this will export the selected objects
node1 = nuke.toNode("Axis1")
node.setSelected(True)
manager.export_to_file(kb_file)
# import the kb file onto locator2 mapping the original name "locator1" to "locator2"
node2 = nuke.createNode('Axis')
obj_mapping = {node1.name(): node2.name()}
manager.import_from_file(file_, objects=[node2.name()], obj_mapping=obj_mapping, ignore_item_chunks=True)