Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New update system #4164

Merged
merged 77 commits into from
Jul 12, 2021
Merged
Changes from 1 commit
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
117d154
Add new event class to pass data about tree updates to main tree handler
Durman Jun 12, 2021
1de28f1
Show the traceback only if in debug mode. It should make it easier to…
Durman Jun 12, 2021
ec76c30
Add new function for drawing a text nearby a node in a node tree edit…
Durman Jun 12, 2021
bad3b6b
Add handler of main tree update (core of new update system). In gener…
Durman Jun 12, 2021
21f16d3
Connect main tree handler to the tree class. Now it overrides most up…
Durman Jun 12, 2021
b2f2964
Move an operator reacting on the escape button to the keymaps module.…
Durman Jun 12, 2021
b6edb47
remove unreachable code - no one node has such attribute in now days.…
Durman Jun 12, 2021
4bc919f
Add supporting muted links
Durman Jun 13, 2021
2d0149a
It looks like with keyboard interrupt the task was not finishing itse…
Durman Jun 13, 2021
14068c2
Fix position of the text when node is collapsed
Durman Jun 14, 2021
778a081
Add updating number of objects displayed in sockets
Durman Jun 14, 2021
08e033a
Connect update current tree and update all buttons to new update syst…
Durman Jun 14, 2021
687098c
Fix temporal viewers operators according logic of new update system (…
Durman Jun 14, 2021
25d6fb2
Fix logic of updating trees upon loading a file for new update system…
Durman Jun 14, 2021
6982c16
Add hasattr for backward compatibility with Blender 2.92 and earlier …
Durman Jun 14, 2021
6d95189
fix name intersection with base class
Durman Jun 15, 2021
f0b0db7
it appeared that input data also can be a tuple (can't be concatenate…
Durman Jun 15, 2021
aec630d
add option not to track node position. If all nodes has text to show…
Durman Jun 15, 2021
eb7c591
change logic according new update system. `tree.init_tree` throttles …
Durman Jun 15, 2021
93cfef7
add some new functions
Durman Jun 17, 2021
987374e
change logic reacting on Undo event for main trees
Durman Jun 17, 2021
aabe20c
I believe this should should the place where an error occurred
Durman Jun 17, 2021
b055c3a
connect new update system and rename BPYNode
Durman Jun 17, 2021
e5e8fbf
return backward compatibility with Python 3.7
Durman Jun 17, 2021
59406c6
add support of drawing text nearby nodes in node groups
Durman Jun 17, 2021
eca70ef
diminish role of NodeStatistic class, now it only keep some informati…
Durman Jun 17, 2021
f842b54
add update time statistic. Simplify tree handler by delegating part o…
Durman Jun 17, 2021
c341e0e
fix case when edit_tree is None
Durman Jun 18, 2021
e1addd2
add annotations and property for group trees
Durman Jun 18, 2021
9180051
fix bug importing tree properties
Durman Jun 18, 2021
c034f17
now updates can be called only via dedicated methods of a tree
Durman Jun 18, 2021
2b26e66
add name of a module and the string where node logging methods were used
Durman Jun 18, 2021
060c87b
Now context trees track changes more accurately. They rebuild tree on…
Durman Jun 18, 2021
4736492
clean out logic of old update system, add removing bgl drawings of gr…
Durman Jun 18, 2021
c4ccf87
now tree_init context manager does not prevent calling of update meth…
Durman Jun 18, 2021
b7fb5a2
fix handling rerout nodes and adopt main group handler to changes in …
Durman Jun 18, 2021
29897a4
Fixing bug of a group node being not updated when they were actually …
Durman Jun 19, 2021
095d8a9
Improving performance of disabled loggers for current logging level a…
Durman Jun 19, 2021
17dc13f
add supporting of the macros inside node groups
Durman Jun 21, 2021
4f2ac03
add wrapper around Blender node groups
Durman Jun 21, 2021
7e2f2cb
fix bug of tree annotations being not removed with nodes inside node …
Durman Jun 21, 2021
0abbcf4
This caused an exception sometimes that None object does not have the…
Durman Jun 21, 2021
4f25332
This cause an error when the node was creating inside node groups bec…
Durman Jun 21, 2021
4c28eaa
Actually it was used not only for showing timings in a console. Proba…
Durman Jun 21, 2021
c0ef777
Remove unused logic by new update system of tree annotations (show er…
Durman Jun 21, 2021
9495ad6
Active tree panel refactoring. Get some settings from Sverchok prefer…
Durman Jun 21, 2021
d40cc36
Remove unused by new update system code. Throttling trees now has no …
Durman Jun 21, 2021
ae42cf5
Now base tree class is ready to be inherited by the group tree class.…
Durman Jun 21, 2021
7683aef
Looks like nodes themselves (according the code above) are calling up…
Durman Jun 21, 2021
922f8c7
Share more code with the main tree handler module
Durman Jun 22, 2021
b9d3c65
Now the method will search appropriate area in Blender screens. Also …
Durman Jun 22, 2021
d87573d
Shift calling update_ui methods of updated trees into the global upda…
Durman Jun 22, 2021
f9dcc02
Solve problem of skipping update during force update (update all and …
Durman Jun 23, 2021
4368af6
Change logic of toggling tree.sv_process. Now when it is switched on …
Durman Jun 23, 2021
825a42b
Clean up redundant protections from tree updates. Now a tree will be …
Durman Jun 23, 2021
8a8d32e
Add frame change event. Unlike other events this one should be un-can…
Durman Jun 23, 2021
3ebb72e
Fixing old name. The bag caused a crash during undo and reloading eve…
Durman Jun 24, 2021
36f6e6b
it always was returning tuplesl. Now it returns one value if there is…
Durman Jun 24, 2021
56c3492
Make node error colors to be taken from the preferences
Durman Jun 25, 2021
87bb3bf
I think it's too tricky to let a node to update a whole tree to get f…
Durman Jun 25, 2021
b5cbf92
Fix using user node colors. New update system was not aware that user…
Durman Jun 25, 2021
609d03d
Fix the operator according to new update system. Well, it's possible …
Durman Jun 25, 2021
8d76146
Remove heat map and some unused functions in the old update system mo…
Durman Jun 25, 2021
2eed7ff
add support of wifi nodes
Durman Jun 28, 2021
a632d84
add cumulative update time. Node groups calculates cumulative time on…
Durman Jun 28, 2021
aa829ba
Probably cause of calling Python thread multiple times during tree ev…
Durman Jun 28, 2021
600d241
Panels refactoring according the suggestions - https://discord.com/ch…
Durman Jun 28, 2021
48d48bd
remove done todos
Durman Jun 28, 2021
b9c3465
Merge remote-tracking branch 'origin/master' into new_update_system
Durman Jun 28, 2021
88d015b
fix missing a tree update during loading a file as a startup file
Durman Jun 29, 2021
0d393a7
fix problem of not registering the event timer if the add-on was enab…
Durman Jun 30, 2021
4eafc85
add surprising information
Durman Jul 9, 2021
a540188
fix docs according changes
Durman Jul 9, 2021
0d697b9
add documentation for new update system
Durman Jul 9, 2021
736866a
fix theme of docs built locally
Durman Jul 9, 2021
1592c08
Merge remote-tracking branch 'origin/master' into new_update_system
Durman Jul 9, 2021
715b4cd
fix Sverchok version
Durman Jul 12, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Prev Previous commit
Next Next commit
Merge remote-tracking branch 'origin/master' into new_update_system
# Conflicts:
#	core/group_handlers.py
#	core/update_system.py
#	node_tree.py
#	ui/sv_temporal_viewers.py
#	utils/exception_drawing_with_bgl.py
  • Loading branch information
Durman committed Jul 9, 2021
commit 1592c08873fdc9e1124781c99f0c478cfe70d3dd
3 changes: 2 additions & 1 deletion .github/workflows/test-sverchok.yml
Original file line number Diff line number Diff line change
@@ -30,7 +30,8 @@ jobs:
run: |
# echo "starting run"
BLENDER_VERSION=2.93
BLENDER_URL=https://ftp.nluug.nl/pub/graphics/blender/release/Blender2.93/blender-2.93.0-linux-x64.tar.xz
BLENDER_URL=https://ftp.nluug.nl/pub/graphics/blender/release/Blender2.93/blender-2.93.1-linux-x64.tar.xz
# BLENDER_URL=https://ftp.nluug.nl/pub/graphics/blender/release/Blender2.93/blender-2.93.0-linux-x64.tar.xz # OLDER
SVERCHOK_DIR=scripts/addons/sverchok
BLENDER_TAR=$(basename $BLENDER_URL)
BLENDER_DIR=$(basename $BLENDER_URL .tar.xz)
87 changes: 0 additions & 87 deletions .travis.yml

This file was deleted.

15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -15,12 +15,15 @@
## English

[RU](https://github.com/nortikin/sverchok/blob/master/README_RU.md)
**Addon for**: [Blender](http://blender.org) version *2.80* and above. For *2.79* see [special installation instruction](https://github.com/nortikin/sverchok/wiki/Sverchok-for-Blender-2.79-installation).
**Addon for**: [Blender](http://blender.org) version *2.93* and above. For *2.79* see [special installation instruction](https://github.com/nortikin/sverchok/wiki/Sverchok-for-Blender-2.79-installation).
**Current sverchok version**: Find version in addon settings or in the node Sverchok panel
**License**: [GPL3](http://www.gnu.org/licenses/quick-guide-gplv3.html)
**Prerequisites**: While sverchok is fundamentally self contained, it does require Python 3.6+, and `numpy`. Both of these are included in recent versions of Blender (precompiled binaries are convenient for this), and do not require any additional steps by the user to obtain. We have added optional nodes that make use of additional libraries; if you have them, Please refer to [wiki page](https://github.com/nortikin/sverchok/wiki/Dependencies) for list of such dependencies and instructions for their installation.
**Prerequisites**: While sverchok is fundamentally self contained, it does require Python 3.9+, and `numpy`. Both of these are included in recent versions of Blender (precompiled binaries are convenient for this), and do not require any additional steps by the user to obtain. We have added optional nodes that make use of additional libraries; if you have them, Please refer to [wiki page](https://github.com/nortikin/sverchok/wiki/Dependencies) for list of such dependencies and instructions for their installation.

**Manual**: [In English](http://nikitron.cc.ua/sverch/html/main.html) - This is an introduction to Sverchok and contains 3 lessons, and documentation on almost all nodes. If anything isn't clear (or missing) in this document please ask about it on the [Issue Tracker](https://github.com/nortikin/sverchok/issues), we want to get these lessons right and you can help us!
**Manual**: [In English](http://nortikin.github.io/sverchok/docs/main.html) - This is an introduction to Sverchok and
contains 3 lessons, and documentation on almost all nodes. If anything isn't clear (or missing) in this document please
ask about it on the [Issue Tracker](https://github.com/nortikin/sverchok/issues), we want to get these lessons right
and you can help us!


### Description
@@ -41,8 +44,8 @@ Comes with more than 600 nodes to help create and manipulate geometry. Combining

- do parametric constructions
- easily change parameters with sliders and formulas
- power nodes such as: Profile parametric, UVconnect, Generative art, Mesh expression, Proportion edit, Wafel, Adaptive Poligons (tissue vectorized), Adaptive edges, ExecNodeMod, Vector Interpolation series of nodes, List manipulators, CSG Boolean, Bmesh ops, Bmesh props, etc.
- do cross sections, extrusions, other modifications with hight level flexible parametrised and vectorised node tools
- power nodes such as: Profile parametric, UVconnect, Generative art, Mesh expression, Proportion edit, Wafel, Adaptive Polygons (tissue vectorized), Adaptive edges, ExecNodeMod, Vector Interpolation series of nodes, List manipulators, CSG Boolean, Bmesh ops, Bmesh props, etc.
- do cross sections, extrusions, other modifications with height level flexible parametrised and vectorised node tools
- calculate areas, volume, and perform other geometric analysis
- make or import CSV tables or custom formats
- use Vector/Scalar fields, create them, visualize data
@@ -51,7 +54,7 @@ Comes with more than 600 nodes to help create and manipulate geometry. Combining
- make your own 'addons' on node layouts and utilise them with Sverchok 3dview panel in your everyday pipeline
- access to Blender Python API (bpy) with special _Set_ and _Get_ nodes
- upgrade Sverchok with pressing one button
- using genetic algorythm in your workflow
- using genetic algorithm in your workflow
- insolation/radiation calculations
- SVG drawing export from node tree
- brep/NURBS/IFC exchange
2 changes: 1 addition & 1 deletion README_RU.md
Original file line number Diff line number Diff line change
@@ -38,7 +38,7 @@

- делать параметрические конструкции
- легко менять параметры слайдерами и формулами
- Супер-узлы: Profile parametric, UVconnect, Generetive art, Mesh expression, Proportion edit, Wafel, Adaptive Poligons (tissue vectorized), Adaptive edges, ExecNodeMod, Vector Interpolation series of nodes, List manipulators, CSG Boolean, Bmesh ops,Bmesh props, и т.д.
- Супер-узлы: Profile parametric, UVconnect, Generetive art, Mesh expression, Proportion edit, Wafel, Adaptive Polygons (tissue vectorized), Adaptive edges, ExecNodeMod, Vector Interpolation series of nodes, List manipulators, CSG Boolean, Bmesh ops,Bmesh props, и т.д.
- делать сечения, выдавливания, другие изменения с гибким параметризованым и векторизованым набором узловых инструментов
- считать площади, объём и прочее
- анализировать геометрию
2 changes: 1 addition & 1 deletion core/__init__.py
Original file line number Diff line number Diff line change
@@ -74,7 +74,7 @@ def handle_reload_event(nodes, imported_modules):


def import_settings(imported_modules, sv_dir_name):
# "settings" treated separately incase the sverchok dir not named "sverchok"
# "settings" treated separately in case the sverchok dir isn't named "sverchok"
settings = importlib.import_module(".settings", sv_dir_name)
imported_modules.append(settings)

2 changes: 1 addition & 1 deletion core/handlers.py
Original file line number Diff line number Diff line change
@@ -46,7 +46,7 @@ def has_frame_changed(scene):

#
# app.handlers.undo_post and app.handlers.undo_pre are necessary to help remove stale
# draw callbacks (bgl / gpu / blf). F.ex the rightlick menu item "attache viewer draw"
# draw callbacks (bgl / gpu / blf). F.ex the rightlick menu item "attach viewer draw"
# will invoke a number of commands as one event, if you undo that event (ctrl+z) then
# there is never a point where the node can ask "am i connected to anything, do i need
# to stop drawing?". When the Undo event causes a node to be removed, its node.free function
6 changes: 3 additions & 3 deletions core/socket_conversions.py
Original file line number Diff line number Diff line change
@@ -90,7 +90,7 @@ def get_all(data):
return [quaternions]


def is_matrix(mat): # doesnt work with Mathutils.Matrix ?
def is_matrix(mat): # doesn't work with Mathutils.Matrix ?
''' expensive function call? '''
if not isinstance(mat, (tuple, list)) or not len(mat) == 4:
return
@@ -160,14 +160,14 @@ def matrices_to_quaternions(socket, source_data):
return get_quaternions_from_matrices(source_data)

def string_to_vector(socket, source_data):
# it can be so that socket is string but data their are already vectors, performace-wise we check only first item
# it can be so that socket is string but data their are already vectors, performance-wise we check only first item
if isinstance(source_data[0][0], (float, int)):
return [[(v, v, v) for v in obj] for obj in source_data]
return source_data


def string_to_color(socket, source_data):
# it can be so that socket is string but data their are already colors, performace-wise we check only first item
# it can be so that socket is string but data their are already colors, performance-wise we check only first item
if isinstance(source_data[0][0], (float, int)):
return [[(v, v, v, 1) for v in obj] for obj in source_data]
if len(source_data[0][0]) == 3:
2 changes: 1 addition & 1 deletion core/sockets.py
Original file line number Diff line number Diff line change
@@ -396,7 +396,7 @@ def sv_get(self, default=sentinel, deepcopy=True, implicit_conversions=None):
If socket uses custom implicit_conversion it should implements default_conversion_name attribute
Also a socket can use its default_property
Order of getting data (if available):
1. writen socket data
1. written socket data
2. node default property
3. socket default property
4. script default property
10 changes: 5 additions & 5 deletions data_structure.py
Original file line number Diff line number Diff line change
@@ -161,9 +161,9 @@ def match_long_cycle(lsts):
return list(map(list, zip(*zip(*tmp))))


# when you intent to use lenght of first list to control WHILE loop duration
# when you intent to use length of first list to control WHILE loop duration
# and you do not want to change the length of the first list, but you want the second list
# lenght to by not less than the length of the first
# length to by not less than the length of the first
def second_as_first_cycle(F, S):
if len(F) > len(S):
return list(map(list, zip(*zip(*[F, itertools.cycle(S)]))))[1]
@@ -761,7 +761,7 @@ def describe_data_shape(data):
Returns string.
Can be used for debugging or for displaying information to user.
Note: this method inspects only first element of each list/tuple,
expecting they are all homogenous (that is usually true in Sverchok).
expecting they are all homogeneous (that is usually true in Sverchok).

describe_data_shape(None) == 'Level 0: NoneType'
describe_data_shape(1) == 'Level 0: int'
@@ -989,7 +989,7 @@ def Matrix_generate(prop):


def Matrix_location(prop, to_list=False):
"""return a list of locations represeting the translation of the matrices"""
"""return a list of locations representing the translation of the matrices"""
Vectors = []
for p in prop:
if to_list:
@@ -1000,7 +1000,7 @@ def Matrix_location(prop, to_list=False):


def Matrix_scale(prop, to_list=False):
"""return a Vector()/list represeting the scale factor of the matrices"""
"""return a Vector()/list representing the scale factor of the matrices"""
Vectors = []
for p in prop:
if to_list:
13 changes: 12 additions & 1 deletion dependencies.py
Original file line number Diff line number Diff line change
@@ -128,7 +128,7 @@ def draw_message(box, package, dependencies=None):
info(freecad_d.message)
FreeCAD = None

cython_d = sv_dependencies["cython"] = SvDependency("Cython", "https://www.freecadweb.org/")
cython_d = sv_dependencies["cython"] = SvDependency("Cython", "https://cython.org/")
cython_d.pip_installable = True
try:
import Cython
@@ -139,6 +139,17 @@ def draw_message(box, package, dependencies=None):
info(cython_d.message)
Cython = None

numba_d = sv_dependencies["numba"] = SvDependency("Numba", "https://numba.pydata.org/")
numba_d.pip_installable = True
try:
import numba
numba_d.message = "Numba package is available"
numba_d.module = numba
except ImportError:
numba_d.message = "Numba package is not available, njit compiled functions will not be available"
info(numba_d.message)
numba = None

good_names = [d.package for d in sv_dependencies.values() if d.module is not None and d.package is not None]
if good_names:
info("Dependencies available: %s.", ", ".join(good_names))
4 changes: 2 additions & 2 deletions docs/Unit_00/soft_intro_01.rst
Original file line number Diff line number Diff line change
@@ -44,13 +44,13 @@ NodeView and 3DView

From the NodeView, you can use the following ways to add nodes to tree:

* Use the **Add** menu from menu bar (Sverchok has little control over how this menu is layed out, protip: use the next method instead)
* Use the **Add** menu from menu bar (Sverchok has little control over how this menu is laid out, protip: use the next method instead)

|image6|

* Hit *Shift-A* (standard Blender's shortcut for adding things, we inject our own menu into it, with icons!):

- don't be alarmed if what you see in your menu is not 100% identical to this image, new features are continously added/changed.
- don't be alarmed if what you see in your menu is not 100% identical to this image, new features are continuously added/changed.

|image7|

4 changes: 2 additions & 2 deletions docs/Unit_01/lesson_01.rst
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ Lesson 01 - A Plane

Nodes covered in this lesson: ``Scalar Math, Vector In, Number, Number Range, Viewer Draw, Stethoschope, Simple Topology, Vector Math``.

Let's make a Plane, we will need 4 vectors and we'll define them using math. I'll use the Trigonometric concept of the ``unit-circle`` to get coordinates which are ``0.5 PI`` appart.
Let's make a Plane, we will need 4 vectors and we'll define them using math. I'll use the Trigonometric concept of the ``unit-circle`` to get coordinates which are ``0.5 PI`` apart.

*Note*: The perimeter of a circle is C=2*PI*r . In the unit-circle radius=1 so it's perimter is C=2*PI . For the square we need 4 vertexes with equal distance apart so 2*PI/4=0.5*PI. If you consider that a circle represents an angle of 360 degrees then 2πr=360º and this means that 0*π places represents a vertex at 0 degrees of the circle: 0PI=0º ; 0.5PI=90º ; 1PI=180º ; 1.5PI=270º

@@ -89,7 +89,7 @@ See the outputs of the ``SINCOS X``, each element of these new ranges represent

- ``Add -> Vector -> Vector In``

The `Vector In` node takes as input 1 or more numbers per component. Sockets which are not explicitely connected to will be represented by a zero.
The `Vector In` node takes as input 1 or more numbers per component. Sockets which are not explicitly connected to will be represented by a zero.

1) Connect the resulting ``Cos( x )`` to the first component in of *Vector in*: ``X``
2) Connect the resulting ``Sin( X )`` to the second component in of *Vector in*: ``Y``
2 changes: 1 addition & 1 deletion docs/Unit_01/lesson_02.rst
Original file line number Diff line number Diff line change
@@ -103,7 +103,7 @@ where ``n`` is how many vertices you want, and the 2 here is `2 PI`. This calls
- ``Add -> Numbers -> A Number``

.. Note::
Get in the habbit of adding the core nodes via the Node View's ``Right Click`` menu, it is a quick route to most of these nodes.
Get in the habit of adding the core nodes via the Node View's ``Right Click`` menu, it is a quick route to most of these nodes.

|right_click_menu|

Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.