Python bpy.types.NodeTree() Examples

The following are 3 code examples of bpy.types.NodeTree(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module bpy.types , or try the search function .
Example #1
Source File: CGTNodes.py    From caffe-gui-tool with The Unlicense 6 votes vote down vote up
def getgpus():
    command = ['nvidia-smi', '-L']
    try:
        proc = subprocess.Popen(command, bufsize=1, stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
                                universal_newlines=True)
    except OSError:
        return 'Error'
    lines = []
    while proc.poll() is None:  # while alive
        line = proc.stdout.readline()
        if line:
            # Process output here
            lines.append(line)
    return len(lines)


##################################

# Derived from the NodeTree base type, similar to Menu, Operator, Panel, etc. 
Example #2
Source File: node_tree.py    From GrowthNodes with GNU General Public License v3.0 5 votes vote down vote up
def register():
    bpy.types.NodeTree.textures = CollectionProperty(type=UMOGUIListProperty)
    bpy.types.NodeTree.textures_index = IntProperty()
    bpy.types.NodeTree.objects = CollectionProperty(type=UMOGUIListProperty)
    bpy.types.NodeTree.objects_index = IntProperty() 
Example #3
Source File: node_tree.py    From GrowthNodes with GNU General Public License v3.0 5 votes vote down vote up
def unregister():
    del bpy.types.NodeTree.textures
    del bpy.types.NodeTree.textures_index
    del bpy.types.NodeTree.objects
    del bpy.types.NodeTree.objects_index