pymel.core.other.dbPeek

dbPeek(*args, **kwargs)

The dbpeekcommand is used to analyze the Maya data for information of interest. See a description of the flags for details on what types of things can be analyzed.

Dynamic library stub function

Flags:
Long name (short name) Argument Types Properties
allObjects (all) bool ../../../_images/create.gif ../../../_images/query.gif
 

Ignore any specified or selected objects and peek into all applicable objects. The definition of “allObjects” will vary based on the type of peek being performed - see the flag documentation for details on what it means for a given type. By default if no objects are selected or specified then it will behave as though this flag were set.

count (c) int ../../../_images/create.gif ../../../_images/query.gif
 

Specify a count to be used by the test. Different tests make different use of the count, query the operation to find out how it interprets the value. For example a performance test might use it as the number of iterations to run in the test, an output operation might use it to limit the amount of output it produces.

operation (op) unicode ../../../_images/create.gif ../../../_images/query.gif
 

Specify the peeking operation to perform. The various types are registered at run time and can be listed by querying this flag without a value. If you query it with a value then you get the detail values that peek type accepts and a description of what it does. In query mode, this flag can accept a value.Flag can appear in Create mode of commandFlag can have multiple arguments, passed either as a tuple or a list.

outputFile (of) unicode ../../../_images/create.gif ../../../_images/query.gif
 

Specify the location of a file to which the information is to be dumped. Default will return the value from the command. Use the special names stdoutand stderrto redirect to your command window. The special name msdevis available when debugging on Windows to direct your output to the debug tab in the output window of Visual Studio.

type (t) unicode ../../../_images/create.gif ../../../_images/query.gif
 
Specify the type of operation desired in string form. The acceptable values for the type string are documented in the flag to which they will be applied.

Derived from mel command maya.cmds.dbPeek

Example:

import pymel.core as pm

import maya.cmds as cmds
// Find the available peek operations
pm.dbpeek( op=True, query=True )
# Return: ['metadata', 'nodes', 'references', 'plugIterator'] #
// Describe the detail of a single available type
pm.dbpeek( query=True, op='nodes' )
# Return: 'The operation 'nodes' understands type flags 'attributes, visible'.
The 'visible' flag filters the display list to ignore any hidden
or internal nodes. Default is to show all nodes
Normal display will show a count of nodes in the scene of each
type. Adding the 'attributes' flag includes the attribute count
for each node as well, segregated by static, extension, and dynamic types.
'#
# Describe the detail of a single available operation
pm.dbpeek( query=True, op='plugIterator' )
# Return: 'The test 'plugIterator' doesn't have any type flags.
Suggested iteration count minimum is 1000000 for which the test machine
measured a time of 19.234s.
This tests the performance of the class which iterates over all of the
networked plugs in a plug tree.
'#
pm.dbpeek( op='plugIterator', count=10000 )
# Return: 'Run 10,000 loops of plug iteration over a tree of size 51, depth 4
Total time:   17.0s
Maximum time: 0.81s
Minimum time: 0.23s
Average time: 0.30s
'#
# Run a performance test for 1000000 loops and store the results
pm.dbpeek( op='plugIterator', count=1000000, outputFile='MyFile.txt' )
# Return: 0 #
pm.loadPlugin( 'MetadataSample' )
pm.polyPlane( name='planeLuck' )
pm.dataStructure( asString='name=TestStructure:int32=ID )
pm.importMetadata( asString='channel face\n stream\n TestStream\n TestStructure\n 0\n 99\n 1\n 999\n 2\n 9999\n endStream\n endChannel\n endAssociations" "planeLuckShape' )
# Peek at the newly created metadata
#
pm.dbpeek( op='metadata', type='summary' )
# Return: 'Node planeLuckShape : face( TestStream[3] )' #

Previous topic

pymel.core.other.dagObjectHit

Next topic

pymel.core.other.dbtrace

Core

Core Modules

Other Modules

This Page