remove prints
0.2.4 - fix: scene world transfer - code: remove prints
This commit is contained in:
+11
-17
@@ -94,7 +94,6 @@ def connect_render_layer(rlayer, ng=None, out=None, frame=None):
|
||||
ng_out = fn.create_node('NodeGroupOutput', tree=ngroup, location=(600,0))
|
||||
|
||||
else:
|
||||
print(f'found group node {ng.name}')
|
||||
ngroup = ng.node_tree
|
||||
ng_in = ngroup.nodes.get('Group Input')
|
||||
ng_out = ngroup.nodes.get('Group Output')
|
||||
@@ -103,14 +102,13 @@ def connect_render_layer(rlayer, ng=None, out=None, frame=None):
|
||||
if not rlayer.outputs['Image'].is_linked:
|
||||
sockin = ng.inputs.get(vl_name)
|
||||
if not sockin:
|
||||
print('creating socket', vl_name)
|
||||
sockin = ng.inputs.new('NodeSocketColor', vl_name)
|
||||
sockin = ng.inputs[-1]
|
||||
|
||||
links.new(rlayer.outputs['Image'], sockin)
|
||||
|
||||
## get nodes from frame
|
||||
rl_nodes = [n for n in nodes if n.type == 'R_LAYERS' and n.layer != 'View Layer' and n.parent == frame]
|
||||
# rl_nodes = [n for n in nodes if n.type == 'R_LAYERS' and n.layer != 'View Layer' and n.parent == frame]
|
||||
|
||||
# auto clean : if an input exists but is not linked and name not exists in rlayers of current frame
|
||||
for s in reversed(ng.inputs):
|
||||
@@ -138,16 +136,14 @@ def connect_render_layer(rlayer, ng=None, out=None, frame=None):
|
||||
ng.update()
|
||||
|
||||
if not connected:
|
||||
print('need to connect')
|
||||
# add AA and connect
|
||||
aa = fn.new_aa_node(ngroup)
|
||||
groupout = ng.outputs.get(vl_name)
|
||||
if not groupout:
|
||||
print('create group out-socket')
|
||||
ng.outputs.new('NodeSocketColor', vl_name) # assigning direcly doesn't link well
|
||||
groupout = ng.outputs[-1]
|
||||
|
||||
print('ng_out.inputs.get(vl_name): ', ng_out.inputs.get(vl_name))
|
||||
# print('ng_out.inputs.get(vl_name): ', ng_out.inputs.get(vl_name))
|
||||
# ng_in.outputs[vl_name]
|
||||
ngroup.links.new(ng_in.outputs[vl_name], aa.inputs[0]) # node_tree
|
||||
ngroup.links.new(aa.outputs[0], ng_out.inputs[vl_name]) # node_tree
|
||||
@@ -197,7 +193,7 @@ def connect_render_layer(rlayer, ng=None, out=None, frame=None):
|
||||
if not out_input:
|
||||
out.file_slots.new(slot_name)
|
||||
out_input = out.inputs[-1] # assigning directly above doesn't link afterwards
|
||||
print(f'new filouput entry: {out_input}')
|
||||
# print(f'new filouput entry: {out_input}')
|
||||
|
||||
# link to FileOut
|
||||
links.new(groupout, out_input)
|
||||
@@ -221,7 +217,9 @@ def get_set_viewlayer_from_gp(ob, l, scene=None):
|
||||
|
||||
in_rds = scene.collection.all_objects.get(ob.name)
|
||||
if not in_rds:
|
||||
# TODO : link with a ob.data copy if its a multiuser object !
|
||||
scene.collection.objects.link(ob)
|
||||
ob.hide_viewport = ob.hide_render = False
|
||||
|
||||
# create viewlayer
|
||||
vl_name = f'{ob.name} / {l.info}'
|
||||
@@ -239,10 +237,10 @@ def get_set_viewlayer_from_gp(ob, l, scene=None):
|
||||
for f in nodes if f.type == 'FRAME'}
|
||||
|
||||
# debug print
|
||||
for k,v in frame_dic.items():
|
||||
print('-', k)
|
||||
for n in v:
|
||||
print('---', n.layer)
|
||||
# for k,v in frame_dic.items():
|
||||
# print('-', k)
|
||||
# for n in v:
|
||||
# print('---', n.layer)
|
||||
|
||||
if rlayer_list: # rlayer exists
|
||||
print(f'{len(rlayer_list)} nodes using {vl_name}')
|
||||
@@ -268,16 +266,13 @@ def get_set_viewlayer_from_gp(ob, l, scene=None):
|
||||
all_frames = [n for n in nodes if n.type == 'FRAME']
|
||||
# all_rl_x = [n.location.x for n in nodes if n.type == 'R_LAYERS' and n.layer != 'View Layer']
|
||||
if all_frames:
|
||||
print
|
||||
# all_frames.sort(key=lambda x: x.location.y, reverse=True)
|
||||
# loc.y - dim.y
|
||||
y_loc = min(fn.get_frame_transform(f, node_tree)[0].y - fn.get_frame_transform(f, node_tree)[1].y for f in all_frames)
|
||||
print('y_loc: ', y_loc)
|
||||
loc = (0, y_loc)
|
||||
else:
|
||||
loc = (0,0)
|
||||
|
||||
print('loc: ', loc)
|
||||
# create frame at new rl position
|
||||
frame = nodes.new('NodeFrame')
|
||||
frame.label = ob.name
|
||||
@@ -309,7 +304,6 @@ def get_set_viewlayer_from_gp(ob, l, scene=None):
|
||||
# get nodes order to insert
|
||||
rl_nodes.sort(key=lambda n: fn.real_loc(n).y, reverse=True) # descending
|
||||
top_loc = fn.real_loc(rl_nodes[0])
|
||||
print('top_loc: ', top_loc)
|
||||
else:
|
||||
top_loc = fn.get_frame_transform(frame[1], node_tree) - 60
|
||||
|
||||
@@ -327,10 +321,10 @@ def get_set_viewlayer_from_gp(ob, l, scene=None):
|
||||
rl_nodes.sort(key=lambda x : names.index(x.layer.split(' / ')[1])) # Sort True layer name from rl
|
||||
|
||||
offset = 0
|
||||
print(f'number of nodes in frame: {len(rl_nodes)}')
|
||||
# print(f'number of nodes in frame: {len(rl_nodes)}')
|
||||
ref_node = rl_nodes[0]
|
||||
|
||||
print('ref_node: ', ref_node.name, ref_node.location)
|
||||
# print('ref_node: ', ref_node.name, ref_node.location)
|
||||
for n in rl_nodes:
|
||||
# set x loc from first node in list (maybe use leftmost ?)
|
||||
n.location = Vector((fn.real_loc(ref_node)[0], top_loc[1] - offset)) - n.parent.location
|
||||
|
||||
Reference in New Issue
Block a user