pymel.core.general.createNode

static general.createNode(*args, **kwargs)

This command creates a new node in the dependency graph of the specified type.

Flags:
Long name (short name) Argument Types Properties
name (n) unicode ../../../_images/create.gif
 
Sets the name of the newly-created node.
parent (p) unicode ../../../_images/create.gif
 
Specifies the parent in the DAG under which the new node belongs.
shared (s) bool ../../../_images/create.gif
 
This node is shared across multiple files, so only create it if it does not already exist.
skipSelect (ss) bool ../../../_images/create.gif
 

This node is not to be selected after creation, the original selection will be preserved. Flag can have multiple arguments, passed either as a tuple or a list.

Derived from mel command maya.cmds.createNode

Example:

import pymel.core as pm

pm.createNode( 'transform', n='transform1' )
# Result: nt.Transform(u'transform1') #
pm.createNode( 'nurbsSurface', n='surface1', p='transform1' )
# Result: nt.NurbsSurface(u'surface1') #
pm.createNode( 'camera', shared=True, n='top' )

# This transform will be selected when created
pm.createNode( 'transform', n='selectedTransform' )
# Result: nt.Transform(u'selectedTransform') #

# This will create a new transform node, but 'selectedTransform'
# will still be selected.
pm.createNode( 'transform', ss=True )
# Result: nt.Transform(u'transform2') #

Previous topic

pymel.core.general.createDisplayLayer

Next topic

pymel.core.general.currentUnit

Core

Core Modules

Other Modules

This Page