一个类其方法和数据的来源可以是自定义,也可以是继承自各级父类。通过dir查看其方法和属性,通过help查看其使用方法。特别地,可通过Base和subclass寻找其父类和其他子类。亦可通过文档研究其继承关系。文档不仅包含自身类,也包括其父类的属性方法。
python >>> help(op("/project1/circle1"))
Help on circleTOP object:
class circleTOP(TOP)
| This class inherits from the TOP class.
| It references a specific Circle TOP.
|
| Method resolution order:
| circleTOP
| TOP
| OP
| builtins.object
|
| Methods defined here:
|
| __init__(self, /, *args, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| ----------------------------------------------------------------------
| Static methods defined here:
|
| __new__(*args, **kwargs) from builtins.type
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Data and other attributes defined here:
|
| OPType = 'circleTOP'
|
| family = 'TOP'
|
| icon = 'Cir'
|
| isCustom = False
|
| isFilter = False
|
| isMultiInputs = True
|
| label = 'Circle'
|
| licenseType = 'Non-Commercial'
|
| maxInputs = 1
|
| minInputs = 0
|
| opType = 'circleTOP'
|
| subType = ''
|
| supported = 1
|
| type = 'circle'
|
| visibleLevel = 0
|
| ----------------------------------------------------------------------
| Methods inherited from TOP:
|
| cudaMemory(...)
| cudaMemory() -> CUDAMemory
| Copies the contents of the TOP to a newly allocated block of raw CUDA memory. The CUDA memory will be deallocated when the returned CUDAMemory object is deallocated. Ensure you keep a reference to the returned object around as long as you are using it.
|
| numpyArray(...)
| numpyArray(delayed=False, writable=False) -> numpy.array
| Returns the TOP image as a Python NumPy array. Note that since NumPy arrays are referenced by line first, pixels are addressed as [h, w]. Currently data will always be in floating point, regardless of what the texture data format is on the GPU.
|
| Args:
| delayed - (Keyword, Optional) If set to True, the download results will be delayed until the next call to numpyArray(), avoiding stalling the GPU waiting for the result immediately. This is useful to avoid long stalls that occur if immediately asking for the result. Each call with return the image that was 'current' on the previous call to numpyArray(). None will be returned if there isn't a result available. You should always check the return value against None to make sure you have a result. Call numpyArray() again, ideally on the next frame or later, to get the result. If you always need a result, you can call numpyArray() a second time in the event None is returned on the first call.
| writable - (Keyword, Optional) If set to True, the memory in the numpy array will be allocated in such a way that writes to it arn't slow. By default the memory the numpy array holds can be allocated in such a way that is very slow to write to. Note that in either case, writing to the numpy array will *not* change the data in the TOP.
|
| sample(...)
| sample(x=None,y=None,z=None,u=None,v=None,w=None) -> tuple(r,g,b,a)
| Returns a 4-tuple representing the color value at the specified texture location. One horizontal and one vertical component must be specified. Note that this is a very expensive operation currently. It will always stall the graphics pipeline if the TOP is currently queued to get updated, and then downloads the entire texture (not just the requested pixel). Use this for debugging and non-realtime workflows only.
|
| Args:
| x - (Keyword, Optional) The horizontal pixel coordinate to be sampled.
| y - (Keyword, Optional) The vertical pixel coordinate to be sampled.
| z - (Keyword, Optional) The depth pixel coordinate to be sampled. Available in builds 2022.23800 and later.
| u - (Keyword, Optional) The normalized horizontal coordinate to be sampled.
| v - (Keyword, Optional) The normalized vertical coordinate to be sampled.
| w - (Keyword, Optional) The normalized depth pixel coordinate to be sampled. Available in builds 2022.23800 and later.
|
| Example:
| r = n.sample(x=25,y=100)[0] #The red component at pixel 25,100.
| g = n.sample(u=0.5,v=0.5)[1] #The green component at the central location.
| b = n.sample(x=25,v=0.5)[2] #The blue 25 pixels across, and half way down.
|
| save(...)
| save(filepath, asynchronous=False, createFolders=False, quality=1.0, metadata=[]) -> filepath
| Saves the image to the file system. Support file formats are: .tif, .tiff, .jpg, .jpeg, .bmp, .png, .exr and .dds. Returns the filename and path used.
|
| Args:
| filepath - (Optional) The path and filename to save to. If not given then a default filename will be used, and the file will be saved in the project.folder folder.
| aysnchronous - (Keyword, Optional) If True, the save will occur in another thread. The file may not be done writing at the time this function returns.
| createFolders - (Keyword, Optional) If True, folders listed in the path that don't exist will be created.
| quality - (Keyword, Optional) Specify the compression quality used. Values range from 0 (lowest quality, small size) to 1 (best quality, largest size).
| metadata - (Keyword, Optional) A list of string pairs that will be inserted into the file's metadata section. Any type of list structure is supported (dictionary, tuple, etc) as long as each metadata item has two entries (key & value). Note: Only supported on EXR files.
|
| Example:
| name = n.save() #save in default format with default name.
| n.save('picture.jpg')
| n.save('image.exr', metadata=[ ("my_key", "my_value"), ("author_name", "derivative") ] ); # save as .exr with custom metadata
|
| saveByteArray(...)
| saveByteArray(filetype, quality=1.0, metadata=[]) -> bytearray
| Saves the image to a bytearray object in the requested file format. Support file formats are: .tif, .tiff, .jpg, .jpeg, .bmp, .png, .exr and .dds. Returns the bytearray object. To get the raw image data use numpyArray() or cudaArray() instead.
|
| Args:
| filetype - (Optional) A string specifying the file type to save as. If not given the default file type '.tiff' will be used. Just the suffix of the string is used to determine the file type. E.g '.tiff', 'file.tiff', 'C:/Files/file.tiff' will all work. Suffix must include the period.
| quality - (Keyword, Optional) Specify the compression quality used. Values range from 0 (lowest quality, small size) to 1 (best quality, largest size).
| metadata - (Keyword, Optional) A list of string pairs that will be inserted into the file's metadata section. Any type of list structure is supported (dictionary, tuple, etc) as long as each metadata item has two entries (key & value). Note: Only supported on EXR files.
|
| Example:
| arr = n.saveByteArray() # save in default format.
| arr = n.saveByteArray('.jpg') # save as .jpg
| arr = n.saveByteArray('.exr', metadata=[ ("my_key", "my_value"), ("author_name", "derivative") ] ); # save as .exr with custom metadata
|
| ----------------------------------------------------------------------
| Data descriptors inherited from TOP:
|
| aspect
| Texture aspect ratio, width divided by height.
|
| aspectHeight
| Texture aspect ratio, height.
|
| aspectWidth
| Texture aspect ratio, width.
|
| curPass
| The current cooking pass iteration, beginning at 0. The total can be set with the 'Passes' parameter on the operator's common page.
|
| depth
| Texture depth, when using a 3 dimensional texture.
|
| height
| Texture height, measured in pixels.
|
| width
| Texture width, measured in pixels.
|
| ----------------------------------------------------------------------
| Methods inherited from OP:
|
| __add__(self, value, /)
| Return self+value.
|
| __bool__(self, /)
| self != 0
|
| __delattr__(self, name, /)
| Implement delattr(self, name).
|
| __eq__(self, value, /)
| Return self==value.
|
| __ge__(self, value, /)
| Return self>=value.
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __getstate__(...)
| __getstate__() -> dict
| Returns a dictionary with persistent data about the object suitable for pickling and deep copies.
|
| __gt__(self, value, /)
| Return self>value.
|
| __hash__(self, /)
| Return hash(self).
|
| __le__(self, value, /)
| Return self<=value.
|
| __lt__(self, value, /)
| Return self<value.
|
| __mul__(self, value, /)
| Return self*value.
|
| __ne__(self, value, /)
| Return self!=value.
|
| __radd__(self, value, /)
| Return value+self.
|
| __repr__(self, /)
| Return repr(self).
|
| __rmul__(self, value, /)
| Return value*self.
|
| __setattr__(self, name, value, /)
| Implement setattr(self, name, value).
|
| __setstate__(...)
| __setstate__(dict)
| Reads the dictionary to update persistent details about the object, suitable for unpickling and deep copies.
|
| __str__(self, /)
| Return str(self).
|
| addError(...)
| addError(msg) -> None
| Adds an error to an operator. Only valid if added while the operator is cooking. (Example Script SOP, CHOP, DAT).
|
| Args:
| msg - The error to add.
|
| addScriptError(...)
| addScriptError(msg) -> None
| Adds a script error to a node.
|
| Args:
| msg - The error to add.
|
| addWarning(...)
| addWarning(msg) -> None
| Adds a warning to an operator. Only valid if added while the operator is cooking. (Example Script SOP, CHOP, DAT).
|
| Args:
| msg - The error to add.
|
| changeType(...)
| changeType(OPtype) -> OP
| Change referenced operator to a new operator type. After this call, this OP object should no longer be referenced. Instead use the returned OP object.
|
| Args:
| OPtype - The python class name of the operator type you want to change this operator to. This is not a string, but instead is a class defined in the global td module.
|
| Example:
| n = op('wave1').changeType(nullCHOP) #changes 'wave1' into a Null CHOP
| n = op('text1').changeType(tcpipDAT) #changes 'text1' operator into a TCPIP DAT
|
| childrenCPUMemory(...)
| childrenCPUMemory() -> int
| Returns the total CPU memory usage for all the children from this COMP.
|
| childrenGPUMemory(...)
| childrenGPUMemory() -> int
| Returns the total GPU memory usage for all the children from this COMP.
|
| clearScriptErrors(...)
| clearScriptErrors(recurse=False, error='*') -> None
| Clear any errors generated during script execution. These may be generated during execution of DATs, Script Nodes, Replicator COMP callbacks, etc.
|
| Args:
| recurse - Clear script errors in any children or subchildren as well.
| error - Pattern to match when clearing errors
|
| Example:
| op('/project1').clearScriptErrors(recurse=True)
|
| closeViewer(...)
| closeViewer(topMost=False) -> None
| Close the floating content viewers of the OP.
|
| Args:
| topMost - (Keyword, Optional) If True, any viewer window containing any parent of this OP is closed instead.
|
| Example:
| op('wave1').closeViewer()
| op('wave1').closeViewer(topMost=True) # any viewer that contains 'wave1' will be closed.
|
| cook(...)
| cook(force=False, recurse=False, includeUtility=False) -> None
| Cook the contents of the operator if required.
|
| Args:
| force - (Keyword, Optional) If True, the operator will always cook, even if it wouldn't under normal circumstances.
| recurse - (Keyword, Optional) If True, all children and sub-children of the operator will be cooked.
| includeUtility - (Keyword, Optional) If specified, controls whether or not utility components (eg Comments) are included in the results.
|
| copyParameters(...)
| copyParameters(OP, custom=True, builtin=True) -> None
| Copy all of the parameters from the specified operator. Both operators should be the same type.
|
| Args:
| OP - The operator to copy.
| custom - (Keyword, Optional) When True, custom parameters will be copied.
| builtin - (Keyword, Optional) When True, built in parameters will be copied.
|
| Example:
| op('geo1').copyParameters( op('geo2') )
|
| dependenciesTo(...)
| dependenciesTo(OP) -> list
| Returns a (possibly empty) list of operator dependency paths between this operator and the specified operator. Multiple paths may be found.
|
| destroy(...)
| destroy() -> None
| Destroy the operator referenced by this OP. An exception will be raised if the OP's operator has already been destroyed.
|
| errors(...)
| errors(recurse=False) -> str
| Get error messages associated with this OP.
|
| Args:
| recurse - Get errors in any children or subchildren as well.
|
| evalExpression(...)
| evalExpression(str) -> value
| Evaluate the expression from the context of this OP. Can be used to evaluate arbitrary snippets of code from arbitrary locations.
|
| Args:
| str - The expression to evaluate.
|
| Example:
| op('wave1').evalExpression('me.digits') #returns 1
| If the expression already resides in a parameter, use that parameters evalExpression() method instead.
|
| fetch(...)
| fetch(key, default, search=True, storeDefault=False) -> value
| Return an object from the OP storage dictionary. If the item is not found, and a default it supplied, it will be returned instead.
|
| Args:
| key - The name of the entry to retrieve.
| default - (Optional) If provided and no item is found then the passed value/object is returned instead.
| storeDefault - (Keyword, Optional) If True, and the key is not found, the default is stored as well.
| search - (Keyword, Optional) If True, the parent of each OP is searched recursively until a match is found
|
| Example:
| v = n.fetch('sales5', 0.0)
|
| fetchOwner(...)
| fetchOwner(key) -> OP
| Return the operator which contains the stored key, or None if not found.
|
| Args:
| key - The key to the stored entry you are looking for.
|
| Example:
| who = n.fetchOwner('sales5') #find the OP that has a storage entry called 'sales5'
|
| openMenu(...)
| openMenu(x=None, y=None) -> None
| Open a node menu for the operator at x, y. Opens at mouse if x & y are not specified.
|
| Args:
| x - (Keyword, Optional) The X coordinate of the menu, measured in screen pixels.
| y - (Keyword, Optional) The Y coordinate of the menu, measured in screen pixels.
|
| openParameters(...)
| openParameters() -> None
| Open a floating dialog containing the operator parameters.
|
| openViewer(...)
| openViewer(unique=False, borders=True) -> None
| Open a floating content viewer for the OP.
|
| Args:
| unique - (Keyword, Optional) If False, any existing viewer for this OP will be re-used and popped to the foreground. If unique is True, a new window is created each time instead.
| borders - (Keyword, Optional) If true, the floating window containing the viewer will have borders.
|
| Example:
| op('geo1').openViewer(unique=True, borders=False) # opens a new borderless viewer window for 'geo1'
|
| ops(...)
| ops(pattern1, pattern2.., includeUtility=False) -> list of OPs
| Returns a (possibly empty) list of OPs that match the patterns, relative to the inside of this OP.
| Multiple patterns may be provided. Numeric OP ids may also be used.
|
| Args:
| pattern - Can be string following the Pattern Matching rules, specifying which OPs to return, or an integer, which must be an OP Id. Multiple patterns can be given and all matched OPs will be returned.
| includeUtility - (Keyword, Optional) If specified, controls whether or not utility components (eg Comments) are included in the results.
| Note: a version of this method that searches relative to '/' is also in the global td module.
|
| Example:
| newlist = n.ops('arm*', 'leg*', 'leg5/foot*')
|
| pars(...)
| pars(pattern) -> list
| Returns a (possibly empty) list of parameter objects that match the pattern.
|
| Args:
| pattern - Is a string following the Pattern Matching rules, specifying which parameters to return.
|
| Example:
| newlist = op('geo1').pars('t?', 'r?', 's?') #translate/rotate/scale parameters
| op('geo1').par[name]
|
| relativePath(...)
| relativePath(OP) -> str
| Returns the relative path from this operator to the OP that is passed as the argument. See OP.shortcutPath for a version using expressions.
|
| resetNodeSize(...)
| resetNodeSize() -> None
| Reset the node tile size to its default width and height.
|
| resetViewer(...)
| resetViewer(recurse=False) -> None
| Reset the OP content viewer to default view settings.
|
| Args:
| recurse - (Keyword, Optional) If True, this is done for all children and sub-children as well.
|
| Example:
| op('/').resetViewer(recurse=True) # reset the viewer for all operators in the entire file.
|
| scriptErrors(...)
| scriptErrors(recurse=False) -> str
| Get script error messages associated with this OP.
|
| Args:
| recurse - Get errors in any children or subchildren as well.
|
| setInputs(...)
| setInputs(listOfOPs) -> None
| Set all the operator inputs to the specified list.
|
| Args:
| listOfOPs - A list containing one or more OPs. Entries in the list can be None to disconnect specific inputs. An empty list disconnects all inputs.
|
| shortcutPath(...)
| shortcutPath(OP, toParName=None) -> str
| Returns an expression from this operator to the OP that is passed as the argument. See OP.relativePath for a version using relative path constants.
|
| Args:
| toParName - (Keyword, Optional) Return an expression to this parameter instead of its operator.
|
| store(...)
| store(key, value) -> value
| Add the key/value pair to the OP's storage dictionary, or replace it if it already exists. If this value is not intended to be saved and loaded in the toe file, it can be be given an alternate value for saving and loading, by using the method storeStartupValue described below.
|
| Args:
| key - A string name for the storage entry. Use this name to retrieve the value using fetch().
| value - The value/object to store.
|
| Example:
| n.store('sales5', 34.5) # stores a floating point value 34.5.
| n.store('moviebank', op('/project1/movies')) # stores an OP for easy access later on.
|
| storeStartupValue(...)
| storeStartupValue(key, value) -> None
| Add the key/value pair to the OP's storage startup dictionary. The storage element will take on this value when the file starts up.
|
| Args:
| key - A string name for the storage startup entry.
| value - The startup value/object to store.
|
| Example:
| n.storeStartupValue('sales5', 1) # 'sales5' will have a value of 1 when the file starts up.
|
| unstore(...)
| unstore(keys1, keys2..) -> None
| For key, remove it from the OP's storage dictionary. Pattern Matching is supported as well.
|
| Args:
| keys - The name or pattern defining which key/value pairs to remove from the storage dictionary.
|
| Example:
| n.unstore('sales*') # removes all entries from this OPs storage that start with 'sales'
|
| unstoreStartupValue(...)
| unstoreStartupValue(keys1, keys2..) -> None
| For key, remove it from the OP's storage startup dictionary. Pattern Matching is supported as well. This does not affect the stored value, just its startup value.
|
| Args:
| keys - The name or pattern defining which key/value pairs to remove from the storage startup dictionary.
|
| Example:
| n.unstoreStartupValue('sales*') # removes all entries from this OPs storage startup that start with 'sales'
|
| var(...)
| var(name, search=True) -> str
| Evaluate a variable. This will return the empty string, if not found. Most information obtained from variables (except for Root and Component variables) are accessible through other means in Python, usually in the global td module.
|
| Args:
| name - The variable name to search for.
| search - (Keyword, Optional) If set to True (which is default) the operator hierarchy is searched until a variable matching that name is found. If false, the search is constrained to the operator.
|
| warnings(...)
| warnings(recurse=False) -> str
| Get warning messages associated with this OP.
|
| Args:
| recurse - Get warnings in any children or subchildren as well.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from OP:
|
| activeViewer
| Get or set Viewer Active Flag.
|
| allowCooking
| Get or set Cooking Flag. Only COMPs can disable this flag.
|
| base
| Returns the beginning portion of the name occurring before any digits.
|
| builtinPars
| A list of all built-in parameters.
|
| bypass
| Get or set Bypass Flag.
|
| children
| A list of operators contained within this operator. Only component operators have children, otherwise an empty list is returned.
|
| childrenCPUCookAbsFrame
| The absolute frame on which childrenCPUCookTime is based.
|
| childrenCPUCookTime
| The total accumulated cook time of all children of this operator during the last frame. Zero if the operator is not a COMP and/or has no children.
|
| childrenCookAbsFrame
| Deprecated The absolute frame on which childrenCookTime is based.
|
| childrenCookTime
| Deprecated The total accumulated cook time of all children of this operator during the last frame. Zero if the operator is not a COMP and/or has no children.
|
| childrenGPUCookAbsFrame
| The absolute frame on which childrenGPUCookTime is based.
|
| childrenGPUCookTime
| The total accumulated GPU cook time of all children of this operator during the last frame. Zero if the operator is not a COMP and/or has no children.
|
| cloneImmune
| Get or set Clone Immune Flag.
|
| color
| Get or set color value, expressed as a 3-tuple, representing its red, green, blue values. To convert between color spaces, use the built in colorsys module.
|
| comment
| Get or set comment string.
|
| cookAbsFrame
| Last absolute frame at which this operator cooked.
|
| cookEndTime
| Last offset from frame start at which this operator cook ended, expressed in milliseconds. Other operators may have cooked between the start and end time. See the cookTime member for this operator's specific cook duration.
|
| cookFrame
| Last frame at which this operator cooked.
|
| cookStartTime
| Last offset from frame start at which this operator cook began, expressed in milliseconds.
|
| cookTime
| Deprecated Duration of the last measured cook (in milliseconds).
|
| cookedPreviousFrame
| True when this operator has cooked the previous frame.
|
| cookedThisFrame
| True when this operator has cooked this frame.
|
| cpuCookTime
| Duration of the last measured cook in CPU time (in milliseconds).
|
| cpuMemory
| The approximate amount of CPU memory this Operator is using, in bytes.
|
| curPar
| The parameter currently being evaluated. Can be used in a parameter expression to reference itself.
|
| current
| Get or set Current Flag.
|
| currentPage
| Get or set the currently displayed parameter page. It can be set by setting it to another page or a string label.
|
| Example:
|
| customPages
| A list of all custom pages.
|
| customParGroups
| A list of all ParGroups, where a ParGroup is a set of parameters all drawn on the same line of a dialog, sharing the same label.
|
| customPars
| A list of all custom parameters.
|
| customTuplets
| A list of all parameter tuplets, where a tuplet is a set of parameters all drawn on the same line of a dialog, sharing the same label.
|
| digits
| Returns the numeric value of the last consecutive group of digits in the name, or None if not found. The digits can be in the middle of the name if there are none at the end of the name.
|
| display
| Get or set Display Flag.
|
| dock
| Get or set the operator this operator is docked to. To clear docking, set this member to None.
|
| docked
| The (possibly empty) list of operators docked to this node.
|
| error
| (Deprecated.) Get or set the error message associated with this OP.
|
| expose
| Get or set the Expose Flag which hides a node from view in a network.
|
| ext
| The object to search for parent extensions.
|
| Example:
| me.ext.MyClass
|
| gpuCookTime
| Duration of GPU operations during the last measured cook (in milliseconds).
|
| gpuMemory
| The amount of GPU memory this OP is using, in bytes.
|
| id
| Unique id for the operator. This id can also be passed to the op() and ops() methods. Id's are not consistent when a file is re-opened, and will change if the OP is copied/pasted, changes OP types, deleted/undone. The id will not change if the OP is renamed though. Its data type is integer.
|
| inputConnectors
| List of input connectors (on the left side) associated with this operator.
|
| inputs
| List of input operators (via left side connectors) to this operator. To get the number of inputs, use len(OP.inputs).
|
| iop
| The Internal Operator Shortcut object, for accessing internal shortcuts. See also Internal Operators.
|
| Note: a version of this method that searches relative to the current operator is also in the global td Module.
|
| ipar
| The Internal Operator Parameter Shortcut object, for accessing internal shortcuts. See also Internal Parameters.
|
| Note: a version of this method that searches relative to the current operator is also in the global td Module.
|
| isBase
| True if the operator is a Base (miscellaneous) component.
|
| isCHOP
| True if the operator is a CHOP.
|
| isCOMP
| True if the operator is a component.
|
| isDAT
| True if the operator is a DAT.
|
| isMAT
| True if the operator is a Material.
|
| isObject
| True if the operator is an object.
|
| isPanel
| True if the operator is a Panel.
|
| isSOP
| True if the operator is a SOP.
|
| isTOP
| True if the operators is a TOP.
|
| lock
| Get or set Lock Flag.
|
| mod
| Get a module on demand object that searches for DAT modules relative to this operator.
|
| name
| Get or set the operator name.
|
| nodeCenterX
| Get or set node X value, expressed in network editor units, measured from its center.
|
| nodeCenterY
| Get or set node Y value, expressed in network editor units, measured from its center.
|
| nodeHeight
| Get or set node height, expressed in network editor units.
|
| nodeWidth
| Get or set node width, expressed in network editor units.
|
| nodeX
| Get or set node X value, expressed in network editor units, measured from its left edge.
|
| nodeY
| Get or set node Y value, expressed in network editor units, measured from its bottom edge.
|
| numChildren
| Returns the number of children contained within the operator. Only component operators have children.
|
| numChildrenRecursive
| Returns the number of operators contained recursively within this operator. Only component operators have children.
|
| op
| The operator finder object, for accessing operators through paths or shortcuts. Note: a version of this method that searches relative to '/' is also in the global td module.
|
| op(pattern1, pattern2..., includeUtility=False) → OP or None
| <blockquote>
| Returns the first OP whose path matches the given pattern, relative to the inside of this operator. Will return None if nothing is found. Multiple patterns may be specified which are all added to the search. Numeric OP ids may also be used.
|
| Args:
| pattern - Can be string following the Pattern Matching rules, specifying which OP to return, or an integer, which must be an OP Id. Multiple patterns can be given, the first matching OP will be returned.
| includeUtility (Optional) - if True, allow Utility nodes to be returned. If False, Utility operators will be ignored.
|
|
| Example:
| b = op('project1')
| b = op('foot*', 'hand*') #comma separated
| b = op('foot* hand*') #space separated
| b = op(154)
| </blockquote>
| op.shortcut → OP
| <blockquote>
| An operator specified with by a Global OP Shortcut. If no operator exists an exception is raised. These shortcuts are global, and must be unique. That is, cutting and pasting an operator with a Global OP Shortcut specified will lead to a name conflict. One shortcut must be renamed in that case. Furthermore, only components can be given Global OP Shortcuts.
| shortcut - Corresponds to the Global OP Shortcut parameter specified in the target operator.
|
| Example:
| b = op.Videoplayer
| To list all Global OP Shortcuts:
|
| Example:
| for x in op:
| print(x)
| </blockquote>
|
| outputConnectors
| List of output connectors (on the right side) associated with this operator.
|
| outputs
| List of output operators (via right side connectors) from this operator.
|
| pages
| A list of all built-in pages.
|
| par
| An intermediate parameter collection object, from which a specific parameter can be found.
|
| Example:
| n.par.tx
| or
| n.par['tx']
|
| parGroup
| An intermediate parameter collection object, from which a specific parameter group can be found.
|
| Example:
| n.parGroup.t
| or
| n.parGroup['t']
|
| parent
| The Parent Shortcut object, for accessing parent components through indices or shortcuts.
| Note: a version of this method that searches relative to the current operator is also in the global td module.
|
| parent(n) → OP or None
| <blockquote>
| The nth parent of this operator. If n not specified, returns the parent. If n = 2, returns the parent of the parent, etc. If no parent exists at that level, None is returned.
|
| Args:
| n - (Optional) n is the number of levels up to climb. When n = 1 it will return the operator's parent.
|
| Example:
| p = parent(2) #grandfather
| </blockquote>
| parent.shortcut → OP
| <blockquote>
| A parent component specified with a shortcut. If no parent exists an exception is raised.
|
| Args:
| shortcut - Corresponds to the Parent Shortcut parameter specified in the target parent.
|
| Example:
| n = parent.Videoplayer
| See also Parent Shortcut for more examples.</blockquote>
|
| passive
| If true, operator will not cook before its access methods are called. To use a passive version of an operator n, use passive(n).
|
| path
| Full path to the operator.
|
| python
| Get or set parameter expression language as python.
|
| recursiveChildren
| Deprecated. Use op.numChildrenRecursive
|
| render
| Get or set Render Flag.
|
| replicator
| The replicatorCOMP that created this operator, if any.
|
| selected
| Get or set Selected Flag. This controls if the node is part of the network selection. (yellow box around it).
|
| showCustomOnly
| Get or set the Show Custom Only Flag which controls whether or not non custom parameters are display in parameter dialogs.
|
| showDocked
| Get or set Show Docked Flag. This controls whether this node is visible or hidden when it is docked to another node.
|
| storage
| Storage is dictionary associated with this operator. Values stored in this dictionary are persistent, and saved with the operator. The dictionary attribute is read only, but not its contents. Its contents may be manipulated directly with methods such as OP.fetch() or OP.store() described below, or examined with an Examine DAT.
|
| tags
| Get or set a set of user defined strings. Tags can be searched using OP.findChildren() and the OP Find DAT.
| The set is a regular python set, and can be accessed accordingly:
|
| Example:
| n.tags = ['effect', 'image filter']
| n.tags.add('darken')
|
| time
| Time Component that defines the operator's time reference.
|
| totalCooks
| Number of times the operator has cooked.
|
| valid
| True if the referenced operator currently exists, False if it has been deleted.
|
| viewer
| Get or set Viewer Flag.
|
| warning
| (Deprecated.) Get or set the warning message associated with this OP.
python >>> dir(op("/project1/circle1"))
[OPType, __add__, __bool__, __class__, __delattr__, __dir__, __doc__, __eq__, __format__, __ge__, __getattribute__, __getstate__, __gt__, __hash__, __init__, __init_subclass__, __le__, __lt__, __mul__, __ne__, __new__, __radd__, __reduce__, __reduce_ex__, __repr__, __rmul__, __setattr__, __setstate__, __sizeof__, __str__, __subclasshook__, activeViewer, addError, addScriptError, addWarning, allowCooking, aspect, aspectHeight, aspectWidth, base, builtinPars, bypass, changeType, children, childrenCPUCookAbsFrame, childrenCPUCookTime, childrenCPUMemory, childrenCookAbsFrame, childrenCookTime, childrenGPUCookAbsFrame, childrenGPUCookTime, childrenGPUMemory, clearScriptErrors, cloneImmune, closeViewer, color, comment, cook, cookAbsFrame, cookEndTime, cookFrame, cookStartTime, cookTime, cookedPreviousFrame, cookedThisFrame, copyParameters, cpuCookTime, cpuMemory, cudaMemory, curPar, curPass, current, currentPage, customPages, customParGroups, customPars, customTuplets, dependenciesTo, depth, destroy, digits, display, dock, docked, error, errors, evalExpression, expose, ext, family, fetch, fetchOwner, gpuCookTime, gpuMemory, height, icon, id, inputConnectors, inputs, iop, ipar, isBase, isCHOP, isCOMP, isCustom, isDAT, isFilter, isMAT, isMultiInputs, isObject, isPanel, isSOP, isTOP, label, licenseType, lock, maxInputs, minInputs, mod, name, nodeCenterX, nodeCenterY, nodeHeight, nodeWidth, nodeX, nodeY, numChildren, numChildrenRecursive, numpyArray, op, opType, openMenu, openParameters, openViewer, ops, outputConnectors, outputs, pages, par, parGroup, parent, pars, passive, path, python, recursiveChildren, relativePath, render, replicator, resetNodeSize, resetViewer, sample, save, saveByteArray, scriptErrors, selected, setInputs, shortcutPath, showCustomOnly, showDocked, storage, store, storeStartupValue, subType, supported, tags, time, totalCooks, type, unstore, unstoreStartupValue, valid, var, viewer, visibleLevel, warning, warnings, width]
python >>>
标签:__,...,set,python,子类,value,operator,或类,OP From: https://www.cnblogs.com/augustone/p/17739210.html