Created by: zeffii
some ui love.
todo, related
-
nodes\number\easing.py: -
nodes\viz\console_node.py: -
nodes\viz\viewer_2d.py: -
nodes\viz\viewer_texture.py: -
nodes\viz\viewer_texture_lite.py: -
nodes\viz\viewer_waveform_output.py: -
ui\bgl_callback_nodeview.py: -
utils\exception_drawing_with_bgl.py:
each of those nodes must implement a function that calculates the desired X, Y location to start drawing. My preference is that the function is created outside of the node class, called with a reference to the node.
def get_dynamic_xy_for_2d_drawing(node):
"""
take into account the node's absolute location
take into account the node's current width
apply any x, y offset
apply any scaling to the final x, y
"""
x = ...
y = ...
return x, y
something like the easing function would replace the loc
entry with a function
draw_data = {
'mode': 'custom_function',
'tree_name': self.id_data.name[:],
- 'loc': (x, y),
+ 'node_name': self.name[:],
+ 'loc': get_dynamic_xy_for_2d_drawing,
'custom_function': simple28_grid_xy,
'args': (geom, config)
}
nvBGL.callback_enable(n_id, draw_data)