Skip to content

Commit

Permalink
Missing File
Browse files Browse the repository at this point in the history
  • Loading branch information
chasvortex committed Nov 10, 2015
1 parent 0fc3dd4 commit ff4b6cf
Show file tree
Hide file tree
Showing 6 changed files with 1,134 additions and 35 deletions.
26 changes: 1 addition & 25 deletions CGTArrangeHelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,26 +237,6 @@ def ArrangeFunction(context, treename=False):
datacounter += 1


class ArrangeNodes(bpy.types.Operator):
'Automatically layout the selected nodes in a linear and non-overlapping fashion.'
bl_idname = 'nodes.layout'
bl_label = 'Arrange Nodes'
bl_options = {'REGISTER', 'UNDO'}

@classmethod
def poll(cls, context):
valid = False
if context.space_data:
if context.space_data.node_tree:
if context.space_data.node_tree.nodes:
valid = True
return valid

def execute(self, context):
ArrangeFunction(context)
return {'FINISHED'}


def register():
# props
bpy.types.Scene.NWStartAlign = bpy.props.BoolProperty(
Expand All @@ -283,15 +263,11 @@ def register():
default='ignore',
description="How to handle Frame nodes")

bpy.utils.register_class(ArrangeNodes)


def unregister():
# props
del bpy.types.Scene.NWStartAlign
del bpy.types.Scene.NWEndAlign
del bpy.types.Scene.NWSpacing
del bpy.types.Scene.NWDelReroutes
del bpy.types.Scene.NWFrameHandling

bpy.utils.unregister_class(ArrangeNodes)
del bpy.types.Scene.NWFrameHandling
2 changes: 1 addition & 1 deletion CGTGraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from subprocess import PIPE, Popen
from threading import Thread

from .parse import search as findfirstraw
from .IOparse import search as findfirstraw
import bpy
from queue import Queue, Empty
from .IOwriteprototxt import SolveFunction
Expand Down
2 changes: 1 addition & 1 deletion IOcexp.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def LoadCexpFunction(context, tempdata, datacube, loadloss, loadtree):
datacube["originaltree"] = os.path.split(tempdata)[1]
## Load node graph from cexp
prevtrees = bpy.data.node_groups.items()
LoadFunction(prototxt, 0, 0, nh, nw, h, w, False)
LoadFunction(prototxt, 0, 0, nh, nw, h, w)
newtrees = bpy.data.node_groups.items()
tree = list(set(newtrees) - set(prevtrees))[0][1]
tree.name = os.path.split(tempdata)[1]
Expand Down
9 changes: 3 additions & 6 deletions IOloadprototxt.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import os
import random
from .CGTArrangeHelper import ArrangeFunction
from .parse import search as findfirstraw
from .IOparse import search as findfirstraw
import bpy


Expand Down Expand Up @@ -238,7 +238,7 @@ def getlayers(prototxt):
return layers


def LoadFunction(prototxt, y, x, nh=False, nw=False, h=False, w=False, layout=True):
def LoadFunction(prototxt, y, x, nh=False, nw=False, h=False, w=False):
nodetypes = {'Pooling': 'PoolNodeType', 'Eltwise': 'EltwiseNodeType', 'Exp': 'ExpNodeType',
'Convolution': 'ConvNodeType', 'Deconvolution': 'DeConvNodeType', 'InnerProduct': 'FCNodeType',
'Flatten': 'FlattenNodeType', 'Silence': 'SilenceNodeType', 'LRN': 'LRNNodeType',
Expand Down Expand Up @@ -368,9 +368,6 @@ def LoadFunction(prototxt, y, x, nh=False, nw=False, h=False, w=False, layout=Tr
endpos = textlayer.bottoms.index(lastlayer.tops[0])
startpos = 0
link(startnode, endnode, startpos, endpos, links)
if layout:
print('Began Arranging nodes - This takes ~2min for googlenet on an i7')
bpy.ops.nodes.layout('EXEC_DEFAULT')


class Load(bpy.types.Operator):
Expand All @@ -391,7 +388,7 @@ def execute(self, context):
solve = readprototxt(bpy.context.scene['solver'])
prototxt = wholefile + ['\nlayer {\n'] + ['type: "Solver"\n'] + solve + ['\n}\n']
prevtrees = bpy.data.node_groups.items()
LoadFunction(prototxt, y, x,layout=False)
LoadFunction(prototxt, y, x)
newtrees = bpy.data.node_groups.items()
tree = list(set(newtrees) - set(prevtrees))[0][1]
tree.name = 'Loaded'
Expand Down
Loading

0 comments on commit ff4b6cf

Please sign in to comment.