diff --git a/__init__.py b/__init__.py index 809d90dcf3e12c7d2483927533e7969301fdadcd..d6daa392719d82ffb89aca9c16fbbed0e9d19143 100755 --- a/__init__.py +++ b/__init__.py @@ -90,7 +90,7 @@ utils_modules = [ "text_editor_submenu", "text_editor_plugins", # UI operators and tools "sv_panels_tools", "sv_gist_tools", "sv_IO_panel_tools", - "monad", + "monad", "sv_help" #"loadscript", ] diff --git a/docs/404.css b/docs/404.css new file mode 100644 index 0000000000000000000000000000000000000000..725045a320b85c4e3e42cf93994a322acbdab3b4 --- /dev/null +++ b/docs/404.css @@ -0,0 +1,21 @@ +#vh { + margin: auto; + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0; +} +.box{ + border-radius: 11px; + box-shadow: 0 0 8px rgba(0, 0, 0, 0.2); + padding: 25px; + width: 40em; + height: 7em; + background: white; + font-family: sans-serif; +} + +body { + background: #8acdff; +} \ No newline at end of file diff --git a/docs/404.html b/docs/404.html new file mode 100644 index 0000000000000000000000000000000000000000..05a8f3e9171b5a7b2c2cb012a4a5a68aaa7b2ef5 --- /dev/null +++ b/docs/404.html @@ -0,0 +1,24 @@ + + + + + + + Oops + + + + + +
+ Sorry! It appears that {{variable}} doesn't have a document associated with it. +

+ Please contact us on the GitHub issue tracker or any of the following social sites: + G+, VK or Blenderartists. +
+ + + + + + diff --git a/docs/404_custom.html b/docs/404_custom.html new file mode 100644 index 0000000000000000000000000000000000000000..ce030240dc1a276c8a8cabb6e2ebd397dcbf5140 --- /dev/null +++ b/docs/404_custom.html @@ -0,0 +1,24 @@ + + + + + + + Oops + + + + + +
+ Sorry! It appears that Curve Viewer doesn't have a document associated with it. +

+ Please contact us on the GitHub issue tracker or any of the following social sites: + G+, VK or Blenderartists. +
+ + + + + + diff --git a/docs/nodes.rst b/docs/nodes.rst index 1a7fc9545c3b3f950a62f63f646d35269607b240..d4551a409ac31670ed6103e676686d8b8f791462 100644 --- a/docs/nodes.rst +++ b/docs/nodes.rst @@ -5,22 +5,27 @@ Nodes .. toctree:: :maxdepth: 3 - Generators - Transforms - Analyzer - Modifier Change - Modifier Make + Generators + Generators Extended + Transforms + Analyzers + Modifier Change + Modifier Make - Number - Vector - Matrix - Logic - List Main - List Structure + Number + Vector + Matrix + Logic + List Main + List Structure + List Masks + List Mutators - Viz - Text - Scene - Layout + Viz + Text + Scene + Layout + Network - Beta + Beta Nodes + Alpha Nodes diff --git a/docs/nodes/alpha_nodes/alpha_nodes_index.rst b/docs/nodes/alpha_nodes/alpha_nodes_index.rst new file mode 100644 index 0000000000000000000000000000000000000000..816d2e9e29252ba44c0a62af9af76a2093b96503 --- /dev/null +++ b/docs/nodes/alpha_nodes/alpha_nodes_index.rst @@ -0,0 +1,7 @@ +*********** +Alpha Nodes +*********** + +.. toctree:: + :maxdepth: 2 + diff --git a/docs/nodes/analyzer/analyzer.rst b/docs/nodes/analyzers/analyzers_index.rst similarity index 69% rename from docs/nodes/analyzer/analyzer.rst rename to docs/nodes/analyzers/analyzers_index.rst index e685d248d3a5aca5b085d301b02ea59d4a0edec7..5ce695e1558017f518938a283e7198982a2836e0 100644 --- a/docs/nodes/analyzer/analyzer.rst +++ b/docs/nodes/analyzers/analyzers_index.rst @@ -1,20 +1,21 @@ -******** -Analyzer -******** +********* +Analyzers +********* .. toctree:: :maxdepth: 2 area bbox - calc_normals distance_pp edge_angles kd_tree kd_tree_edges mesh_filter + normal + normals polygons_centers + polygons_centers_mk3 raycast - vector_normal volume weights diff --git a/docs/nodes/analyzer/area.rst b/docs/nodes/analyzers/area.rst similarity index 100% rename from docs/nodes/analyzer/area.rst rename to docs/nodes/analyzers/area.rst diff --git a/docs/nodes/analyzer/bbox.rst b/docs/nodes/analyzers/bbox.rst similarity index 100% rename from docs/nodes/analyzer/bbox.rst rename to docs/nodes/analyzers/bbox.rst diff --git a/docs/nodes/analyzer/distance_pp.rst b/docs/nodes/analyzers/distance_pp.rst similarity index 100% rename from docs/nodes/analyzer/distance_pp.rst rename to docs/nodes/analyzers/distance_pp.rst diff --git a/docs/nodes/analyzer/edge_angles.rst b/docs/nodes/analyzers/edge_angles.rst similarity index 100% rename from docs/nodes/analyzer/edge_angles.rst rename to docs/nodes/analyzers/edge_angles.rst diff --git a/docs/nodes/analyzer/kd_tree.rst b/docs/nodes/analyzers/kd_tree.rst similarity index 100% rename from docs/nodes/analyzer/kd_tree.rst rename to docs/nodes/analyzers/kd_tree.rst diff --git a/docs/nodes/analyzer/kd_tree_edges.rst b/docs/nodes/analyzers/kd_tree_edges.rst similarity index 100% rename from docs/nodes/analyzer/kd_tree_edges.rst rename to docs/nodes/analyzers/kd_tree_edges.rst diff --git a/docs/nodes/analyzer/mesh_filter.rst b/docs/nodes/analyzers/mesh_filter.rst similarity index 100% rename from docs/nodes/analyzer/mesh_filter.rst rename to docs/nodes/analyzers/mesh_filter.rst diff --git a/docs/nodes/analyzer/vector_normal.rst b/docs/nodes/analyzers/normal.rst similarity index 100% rename from docs/nodes/analyzer/vector_normal.rst rename to docs/nodes/analyzers/normal.rst diff --git a/docs/nodes/analyzer/calc_normals.rst b/docs/nodes/analyzers/normals.rst similarity index 96% rename from docs/nodes/analyzer/calc_normals.rst rename to docs/nodes/analyzers/normals.rst index a034cfb8e4d0241fb7ddab70289f8da72fe35a3c..7f0286530a1ba1a9f3a44ae1d36aedf866fb5c21 100644 --- a/docs/nodes/analyzer/calc_normals.rst +++ b/docs/nodes/analyzers/normals.rst @@ -1,8 +1,6 @@ Calculate Normals ================= -*destination after Beta: Analyzers* - Functionality ------------- diff --git a/docs/nodes/analyzer/polygons_centers.rst b/docs/nodes/analyzers/polygons_centers.rst similarity index 100% rename from docs/nodes/analyzer/polygons_centers.rst rename to docs/nodes/analyzers/polygons_centers.rst diff --git a/docs/nodes/analyzers/polygons_centers_mk3.rst b/docs/nodes/analyzers/polygons_centers_mk3.rst new file mode 100644 index 0000000000000000000000000000000000000000..39bad56800fb685c819efb8a6e5e98711ebb8da6 --- /dev/null +++ b/docs/nodes/analyzers/polygons_centers_mk3.rst @@ -0,0 +1,37 @@ +Centers Polygons +================ + +Functionality +------------- + +Analizing geometry and finding centers of polygons, normals (from global zero), normals from local centers of polygons and matrices that find polygons rotation. Not works with edges. + +Inputs +------ + +**Vertices** and **Polygons** from object that we analizing. + +Outputs +------- + +**Normals** is normals from global zero coordinates, vector. **Norm_abs** is normals shifted to centers of polygons. **Origins** centers of polygons. **Centers** matrices that has rotation and location of polygons. + +Example of usage +---------------- + +.. image:: https://cloud.githubusercontent.com/assets/5783432/4222939/b86a1d3e-3917-11e4-8e03-c24980672404.jpg + :alt: Centers_of_polygons_normals.jpg + +.. image:: https://cloud.githubusercontent.com/assets/5783432/4222936/b863cb46-3917-11e4-9cfe-0d863c4850b6.jpg + :alt: Centers_of_polygons_normalsabs.jpg + +.. image:: https://cloud.githubusercontent.com/assets/5783432/4222937/b864c8fc-3917-11e4-9368-b5260703e4c5.jpg + :alt: Centers_of_polygons_locations.jpg + +.. image:: https://cloud.githubusercontent.com/assets/5783432/4222949/c5874906-3917-11e4-9c9c-94c016560f98.jpg + :alt: Centers_of_polygons_matrices.jpg + +Problems +-------- + +The code of matrix rotation based on Euler rotation, so when you rotate to plane X-oriented, it makes wrong. We need spherical coordinates and quaternion rotation here, needed help or something diff --git a/docs/nodes/analyzer/raycast.rst b/docs/nodes/analyzers/raycast.rst similarity index 100% rename from docs/nodes/analyzer/raycast.rst rename to docs/nodes/analyzers/raycast.rst diff --git a/docs/nodes/analyzer/volume.rst b/docs/nodes/analyzers/volume.rst similarity index 100% rename from docs/nodes/analyzer/volume.rst rename to docs/nodes/analyzers/volume.rst diff --git a/docs/nodes/analyzer/weights.rst b/docs/nodes/analyzers/weights.rst similarity index 100% rename from docs/nodes/analyzer/weights.rst rename to docs/nodes/analyzers/weights.rst diff --git a/docs/nodes/beta/beta.rst b/docs/nodes/beta_nodes/beta_nodes_index.rst similarity index 86% rename from docs/nodes/beta/beta.rst rename to docs/nodes/beta_nodes/beta_nodes_index.rst index 492312e3cb852962e12644cc7981f2647e9f810d..86e2ddada1479022f95005858e19daa47d8dc940 100644 --- a/docs/nodes/beta/beta.rst +++ b/docs/nodes/beta_nodes/beta_nodes_index.rst @@ -1,9 +1,8 @@ ********** -Beta +Beta Nodes ********** .. toctree:: :maxdepth: 2 set_dataobject - diff --git a/docs/nodes/beta/set_dataobject.rst b/docs/nodes/beta_nodes/set_dataobject.rst similarity index 100% rename from docs/nodes/beta/set_dataobject.rst rename to docs/nodes/beta_nodes/set_dataobject.rst diff --git a/docs/nodes/generator/generator.rst b/docs/nodes/generator/generator.rst deleted file mode 100644 index 3a490fe17c588f1136a4e8aa6dac95284174d8f8..0000000000000000000000000000000000000000 --- a/docs/nodes/generator/generator.rst +++ /dev/null @@ -1,32 +0,0 @@ -********* -Generator -********* - -.. toctree:: - :maxdepth: 2 - - 2pt_spline - 3pt_arc - box - box_rounded - bricks - circle - cylinder - exponential - fibonacci - formula_shape - generative_art - hilbert - hilbert3d - hilbert_image - image - image_decompose - line - ngon - plane - profile_parametric - random_vector - scripted - scripted2 - scripted_intro - sphere diff --git a/docs/nodes/generator/3pt_arc.rst b/docs/nodes/generators/basic_3pt_arc.rst similarity index 100% rename from docs/nodes/generator/3pt_arc.rst rename to docs/nodes/generators/basic_3pt_arc.rst diff --git a/docs/nodes/generator/2pt_spline.rst b/docs/nodes/generators/basic_spline.rst similarity index 100% rename from docs/nodes/generator/2pt_spline.rst rename to docs/nodes/generators/basic_spline.rst diff --git a/docs/nodes/generator/box.rst b/docs/nodes/generators/box.rst similarity index 100% rename from docs/nodes/generator/box.rst rename to docs/nodes/generators/box.rst diff --git a/docs/nodes/generator/bricks.rst b/docs/nodes/generators/bricks.rst similarity index 100% rename from docs/nodes/generator/bricks.rst rename to docs/nodes/generators/bricks.rst diff --git a/docs/nodes/generator/circle.rst b/docs/nodes/generators/circle.rst similarity index 100% rename from docs/nodes/generator/circle.rst rename to docs/nodes/generators/circle.rst diff --git a/docs/nodes/generator/cylinder.rst b/docs/nodes/generators/cylinder.rst similarity index 100% rename from docs/nodes/generator/cylinder.rst rename to docs/nodes/generators/cylinder.rst diff --git a/docs/nodes/generator/formula_shape.rst b/docs/nodes/generators/formula_shape.rst similarity index 100% rename from docs/nodes/generator/formula_shape.rst rename to docs/nodes/generators/formula_shape.rst diff --git a/docs/nodes/generators/generators_index.rst b/docs/nodes/generators/generators_index.rst new file mode 100644 index 0000000000000000000000000000000000000000..b987f24939691ea6579afe82ea7f0c68562fe914 --- /dev/null +++ b/docs/nodes/generators/generators_index.rst @@ -0,0 +1,20 @@ +********** +Generators +********** + +.. toctree:: + :maxdepth: 2 + + basic_3pt_arc + basic_spline + box + bricks + circle + cylinder + formula_shape + image + line + ngon + plane + random_vector + sphere diff --git a/docs/nodes/generator/image.rst b/docs/nodes/generators/image.rst similarity index 100% rename from docs/nodes/generator/image.rst rename to docs/nodes/generators/image.rst diff --git a/docs/nodes/generator/line.rst b/docs/nodes/generators/line.rst similarity index 100% rename from docs/nodes/generator/line.rst rename to docs/nodes/generators/line.rst diff --git a/docs/nodes/generator/ngon.rst b/docs/nodes/generators/ngon.rst similarity index 100% rename from docs/nodes/generator/ngon.rst rename to docs/nodes/generators/ngon.rst diff --git a/docs/nodes/generator/plane.rst b/docs/nodes/generators/plane.rst similarity index 100% rename from docs/nodes/generator/plane.rst rename to docs/nodes/generators/plane.rst diff --git a/docs/nodes/generator/random_vector.rst b/docs/nodes/generators/random_vector.rst similarity index 100% rename from docs/nodes/generator/random_vector.rst rename to docs/nodes/generators/random_vector.rst diff --git a/docs/nodes/generator/sphere.rst b/docs/nodes/generators/sphere.rst similarity index 100% rename from docs/nodes/generator/sphere.rst rename to docs/nodes/generators/sphere.rst diff --git a/docs/nodes/generator/box_rounded.rst b/docs/nodes/generators_extended/box_rounded.rst similarity index 100% rename from docs/nodes/generator/box_rounded.rst rename to docs/nodes/generators_extended/box_rounded.rst diff --git a/docs/nodes/generator/generative_art.rst b/docs/nodes/generators_extended/generative_art.rst similarity index 100% rename from docs/nodes/generator/generative_art.rst rename to docs/nodes/generators_extended/generative_art.rst diff --git a/docs/nodes/generators_extended/generators_extended_index.rst b/docs/nodes/generators_extended/generators_extended_index.rst new file mode 100644 index 0000000000000000000000000000000000000000..19b1f4d0aa74065491cf0f4bbe6811e469a5f7ff --- /dev/null +++ b/docs/nodes/generators_extended/generators_extended_index.rst @@ -0,0 +1,18 @@ +******************* +Generators Extended +******************* + +.. toctree:: + :maxdepth: 2 + + box_rounded + generative_art + hilbert + hilbert3d + hilbert_image + image_components + profile + script + script3 + scripted_intro + script_mk2 diff --git a/docs/nodes/generator/hilbert.rst b/docs/nodes/generators_extended/hilbert.rst similarity index 100% rename from docs/nodes/generator/hilbert.rst rename to docs/nodes/generators_extended/hilbert.rst diff --git a/docs/nodes/generator/hilbert3d.rst b/docs/nodes/generators_extended/hilbert3d.rst similarity index 100% rename from docs/nodes/generator/hilbert3d.rst rename to docs/nodes/generators_extended/hilbert3d.rst diff --git a/docs/nodes/generator/hilbert_image.rst b/docs/nodes/generators_extended/hilbert_image.rst similarity index 100% rename from docs/nodes/generator/hilbert_image.rst rename to docs/nodes/generators_extended/hilbert_image.rst diff --git a/docs/nodes/generator/image_decompose.rst b/docs/nodes/generators_extended/image_components.rst similarity index 100% rename from docs/nodes/generator/image_decompose.rst rename to docs/nodes/generators_extended/image_components.rst diff --git a/docs/nodes/generator/profile_parametric.rst b/docs/nodes/generators_extended/profile.rst similarity index 100% rename from docs/nodes/generator/profile_parametric.rst rename to docs/nodes/generators_extended/profile.rst diff --git a/docs/nodes/generator/scripted.rst b/docs/nodes/generators_extended/script.rst similarity index 100% rename from docs/nodes/generator/scripted.rst rename to docs/nodes/generators_extended/script.rst diff --git a/docs/nodes/generator/scripted2.rst b/docs/nodes/generators_extended/script3.rst similarity index 100% rename from docs/nodes/generator/scripted2.rst rename to docs/nodes/generators_extended/script3.rst diff --git a/docs/nodes/generators_extended/script_mk2.rst b/docs/nodes/generators_extended/script_mk2.rst new file mode 100644 index 0000000000000000000000000000000000000000..c6d496489feafa0a9a5f8942a29381a5cca1bee5 --- /dev/null +++ b/docs/nodes/generators_extended/script_mk2.rst @@ -0,0 +1,293 @@ +Scripted Node 2(Generator) +========================= + +aka Script Node MK2 + +- Introduction +- Features +- Structure +- Templates +- Conveniences +- Examples +- Techniques to improve Python performance +- Limitations + +Introduction +------------ + +When you want to express an idea in written form and the concept is suitable +for a one line Python expression then often you can use a Formula node. If you +need access to imports, classes, temporary variables, and functions then you can +write a script to load into Script Node 2. + +Script Node MK2 differs from Script Node iteratrion 1 in that offers more control. +It also has a prototype system where you could for example reuse the behavior of +a generator and the template takes care of all the details leaving you to focus +on the function. Scripts using the templates automatically becomes more powerful. + +It's a prototype so bug reports, questions and feature request are very welcome. + +Features +-------- + +allows: + +- Loading/Reloading scripts currently in TextEditor +- imports and aliasing, ie anything you can import from console works in SN2 +- nested functions and lambdas +- named inputs and outputs +- named operators (buttons to action something upon button press) + +Structure +--------- + +At present all scripts for SN2 must: + +- be subclasses SvScript +- include a function called process in the class +- have member attributes called ``inputs`` and ``outputs`` +- have one Script class per file, if more than one, last one found will be used + +**process(self)** + + +``process(self)`` is the main flow control function. It is called when all sockets +without defaults are connected. Usually the template provides a ``process`` function +for you. + +**inputs** + +Default can be a float or integer value, not other types are usable yet:: + + inputs = [ + [type, 'socket name on ui', default], + [type, 'socket name on ui2', default], + # ... + ] + + +**outputs** + +:: + + outputs = [ + [type, 'socket name on ui'], + [type, 'socket name on ui 2'], + # ... + ] + +**inputs and outputs** + +- Each *socket name on ui* string shall be unique. + +- **type** are currently limited to + + +---------+-------------------------------------+ + | type id | type data | + +=========+=====================================+ + | 's' | floats, ints, edges, faces, strings | + +---------+-------------------------------------+ + | 'v' | vertices, vectors, 3-tuples | + +---------+-------------------------------------+ + | 'm' | matrices, 4 x 4 nested lists | + +---------+-------------------------------------+ + +There are a series of names that have special meaning that scripts should +avoid as class attributes or only used for the intended meaning. To be described: + ``node`` ``draw_buttons`` ``update`` ``process`` ``enum_func`` ``inputs`` +``outputs`` + + +Templates +--------- + +Sverchok includes a series of examples for the different templates. + + +Conveniences +------------ + +We value our time, we are sure you do too, so features have been added to help speed up the +script creation process. + +**Text Editor** + +- can refresh the Script Node which currently loads that script by hitting ``Ctrl+Enter`` + +Main classes for your subclasses are: + + - ``SvScript`` + - ``SvScriptSimpleGenerator`` + - ``SvScriptSimpleFunction`` + +Limitations +----------- + +Using ``SvScriptSimpleGenerator`` and ``SvScriptSimpleFunction`` you limit inputs to deal with one object. +For plane, for example, you'll get next data: + + [(0.0, 0.0, 0.0), (1.0, 0.0, 0.0), (0.0, 1.0, 0.0), (1.0, 1.0, 0.0)] [(0, 1, 3, 2)] + +If you need Full support of Sverchok data - you'd better use ``SvScript`` +class and ``self.node.inputs[0].sv_get()`` function. + +Examples +-------- + +The best way to get familiarity with Script Node 2 is to go through the templates folder. +They are intended to be lightweight and educational, but some of them will show +advanced use cases. The images and animations on this `thread on github +`_. +may also provide some insight into what's possible. + +A typical nodescript using the ``SvScriptSimpleGenerator`` may look like this, note that +the third argument for outputs is specific to this template:: + + import numpy + import itertools + + class GridGen(SvScriptSimpleGenerator): + inputs = [("s", "Size", 10.0), + ("s", "Subdivs", 10)] + outputs = [("v", "verts", "make_verts"), + ("s", "edges", "make_edges")] + + @staticmethod + def make_verts(size, sub): + side = numpy.linspace(-size / 2, size / 2, sub) + return tuple((x, y, 0) for x, y in itertools.product(side, side)) + + @staticmethod + def make_edges(size, sub): + edges = [] + for i in range(sub): + for j in range(sub - 1): + edges.append((sub * i + j, sub * i + j + 1)) + edges.append((sub * j + i, sub * j + i + sub)) + return edges + + +Note that here the name of the method that should be called for producing data +for each socket in the final last arguments to ``outputs`` but we are not forced +to have all code inside the class, we can also do +:: + + def lorenz(N, verts, h, a, b, c): + add_vert = verts.append + + x0 = 0.1 + y0 = 0 + z0 = 0 + for i in range(N): + x1 = x0 + h * a * (y0 - x0) + y1 = y0 + h * (x0 * (b - z0) - y0) + z1 = z0 + h * (x0 * y0 - c * z0) + x0, y0, z0 = x1, y1, z1 + + add_vert((x1,y1,z1)) + + class LorenzAttractor(SvScriptSimpleGenerator): + + inputs = [ + ['s', 'N', 1000], + ['s', 'h', 0.01], + ['s', 'a', 10.0], + ['s', 'b', 28.0], + ['s', 'c', 8.0/3.0] + ] + + @staticmethod + def make_verts(N, h, a, b, c): + verts = [] + lorenz(N, verts, h, a, b, c) + return verts + + @staticmethod + def make_edges(N, h a, b, c: + edges = [(i, i+1) for i in range(N-1)] + return edges + + outputs = [ + ['v','verts', "make_verts"], + ['s','edges', "make_edges"] + ] + + +Here is a simple script for deleting loose vertices from mesh data, it also serves as an +illustration for a type of script that uses the ```SvScriptSimpleFunction``` template that +has one main function that decomposes into separate sockets. The methods don't have be static +but in general it is good practice to keep them free from side effects. +:: + + from itertools import chain + + class DeleteLooseVerts(SvScriptSimpleFunction): + inputs = [ + ('v', 'verts'), + ('s', 'pol') + ] + outputs = [ + ('v', 'verts'), + ('s', 'pol') + ] + + # delete loose verts + @staticmethod + def function(*args, **kwargs): + ve, pe = args + # find used indexes + v_index = sorted(set(chain.from_iterable(pe))) + # remap the vertices + v_out = [ve[i] for i in v_index] + # create a mapping from old to new vertices index + mapping = dict(((j, i) for i, j in enumerate(v_index))) + # apply mapping to input polygon index + p_out = [tuple(map(mapping.get, p)) for p in pe] + return v_out, p_out + + +Breakout Scripts +---------------- +Scripts that needs to access the node can do so via the ```self.node``` variable +that is automatically set. +:: + + class Breakout(SvScript): + def process(self): + pass + + def update(self): + node = self.node + node_group = self.node.id_data + # here you can do anything to the node or node group + # that real a real node could do including multisocket + # adaptive sockets etc. templates and examples for this are + # coming + + +Admit, you can call sockets data directly when using ```SvScript``` as ```self.node.inputs[0].sv_get()```. +And other ```self.node.``` operations possible from this class. + + +Techniques to improve Python performance +---------------------------------------- + +There are many ways to speed up python code. Some slowness will be down to +innefficient algorithm design, other slowness is caused purely by how much +processing is minimally required to solve a problem. A decent read regarding +general methods to improve python code performance can be found +on `python.org `_. +If you don't know where the cycles are being consumed, then you don't know +if your efforts to optimize will have any significant impact. + +Read these 5 rules by Rob Pike before any optimization. +http://users.ece.utexas.edu/~adnan/pike.html + +Limitations +----------- + +Most limitations are voided by increasing your Python and ``bpy`` skills. But +one should also realize what is approriate for a node script to do. + + +That's it for now. diff --git a/docs/nodes/generator/scripted_intro.rst b/docs/nodes/generators_extended/scripted_intro.rst similarity index 100% rename from docs/nodes/generator/scripted_intro.rst rename to docs/nodes/generators_extended/scripted_intro.rst diff --git a/docs/nodes/layout/socket_converter.rst b/docs/nodes/layout/converter.rst similarity index 100% rename from docs/nodes/layout/socket_converter.rst rename to docs/nodes/layout/converter.rst diff --git a/docs/nodes/layout/layout.rst b/docs/nodes/layout/layout_index.rst similarity index 75% rename from docs/nodes/layout/layout.rst rename to docs/nodes/layout/layout_index.rst index 2e0478d732691d456cc26847adc9b99ff668cb8b..958f951e6a95e6221837b129886f61416b621a0d 100644 --- a/docs/nodes/layout/layout.rst +++ b/docs/nodes/layout/layout_index.rst @@ -5,5 +5,5 @@ Layout .. toctree:: :maxdepth: 2 + converter wifi - socket_converter diff --git a/docs/nodes/list_main/list_decompose.rst b/docs/nodes/list_main/decompose.rst similarity index 100% rename from docs/nodes/list_main/list_decompose.rst rename to docs/nodes/list_main/decompose.rst diff --git a/docs/nodes/list_main/list_math.rst b/docs/nodes/list_main/func.rst similarity index 100% rename from docs/nodes/list_main/list_math.rst rename to docs/nodes/list_main/func.rst diff --git a/docs/nodes/list_main/list_join.rst b/docs/nodes/list_main/join.rst similarity index 100% rename from docs/nodes/list_main/list_join.rst rename to docs/nodes/list_main/join.rst diff --git a/docs/nodes/list_main/list_length.rst b/docs/nodes/list_main/length.rst similarity index 100% rename from docs/nodes/list_main/list_length.rst rename to docs/nodes/list_main/length.rst diff --git a/docs/nodes/list_main/list_del_levels.rst b/docs/nodes/list_main/levels.rst similarity index 100% rename from docs/nodes/list_main/list_del_levels.rst rename to docs/nodes/list_main/levels.rst diff --git a/docs/nodes/list_main/list_main.rst b/docs/nodes/list_main/list_main.rst deleted file mode 100644 index 491e7fbcb8e108e4e855f41bbe14012e7e598145..0000000000000000000000000000000000000000 --- a/docs/nodes/list_main/list_main.rst +++ /dev/null @@ -1,18 +0,0 @@ -********* -List Main -********* - -.. toctree:: - :maxdepth: 2 - - list_decompose - list_join - list_zip - list_del_levels - list_length - list_sum - list_mask_out - list_mask_in - list_match - list_math - list_modifier diff --git a/docs/nodes/list_main/list_main_index.rst b/docs/nodes/list_main/list_main_index.rst new file mode 100644 index 0000000000000000000000000000000000000000..509a7b124aff1936f567c5e44bd7ad06b55648c7 --- /dev/null +++ b/docs/nodes/list_main/list_main_index.rst @@ -0,0 +1,15 @@ +********* +List Main +********* + +.. toctree:: + :maxdepth: 2 + + decompose + func + join + length + levels + match + sum_mk2 + zip diff --git a/docs/nodes/list_main/list_match.rst b/docs/nodes/list_main/match.rst similarity index 100% rename from docs/nodes/list_main/list_match.rst rename to docs/nodes/list_main/match.rst diff --git a/docs/nodes/list_main/list_sum.rst b/docs/nodes/list_main/sum_mk2.rst similarity index 100% rename from docs/nodes/list_main/list_sum.rst rename to docs/nodes/list_main/sum_mk2.rst diff --git a/docs/nodes/list_main/list_zip.rst b/docs/nodes/list_main/zip.rst similarity index 100% rename from docs/nodes/list_main/list_zip.rst rename to docs/nodes/list_main/zip.rst diff --git a/docs/nodes/list_masks/list_masks_index.rst b/docs/nodes/list_masks/list_masks_index.rst new file mode 100644 index 0000000000000000000000000000000000000000..e72701d784b2a2f2226db57097d963bf30858f85 --- /dev/null +++ b/docs/nodes/list_masks/list_masks_index.rst @@ -0,0 +1,9 @@ +********** +List Masks +********** + +.. toctree:: + :maxdepth: 2 + + mask + mask_join diff --git a/docs/nodes/list_main/list_mask_out.rst b/docs/nodes/list_masks/mask.rst similarity index 100% rename from docs/nodes/list_main/list_mask_out.rst rename to docs/nodes/list_masks/mask.rst diff --git a/docs/nodes/list_main/list_mask_in.rst b/docs/nodes/list_masks/mask_join.rst similarity index 100% rename from docs/nodes/list_main/list_mask_in.rst rename to docs/nodes/list_masks/mask_join.rst diff --git a/docs/nodes/list_mutators/list_mutators_index.rst b/docs/nodes/list_mutators/list_mutators_index.rst new file mode 100644 index 0000000000000000000000000000000000000000..69a7f19520d1f1d34d432a3ec5aa0079032af180 --- /dev/null +++ b/docs/nodes/list_mutators/list_mutators_index.rst @@ -0,0 +1,8 @@ +************* +List Mutators +************* + +.. toctree:: + :maxdepth: 2 + + modifier diff --git a/docs/nodes/list_main/list_modifier.rst b/docs/nodes/list_mutators/modifier.rst similarity index 100% rename from docs/nodes/list_main/list_modifier.rst rename to docs/nodes/list_mutators/modifier.rst diff --git a/docs/nodes/list_struct/list_flip.rst b/docs/nodes/list_struct/flip.rst similarity index 100% rename from docs/nodes/list_struct/list_flip.rst rename to docs/nodes/list_struct/flip.rst diff --git a/docs/nodes/list_struct/list_item.rst b/docs/nodes/list_struct/item.rst similarity index 100% rename from docs/nodes/list_struct/list_item.rst rename to docs/nodes/list_struct/item.rst diff --git a/docs/nodes/list_struct/list_struct.rst b/docs/nodes/list_struct/list_struct.rst deleted file mode 100644 index 357bbb76b66252df000a536a38c770e72fe095c8..0000000000000000000000000000000000000000 --- a/docs/nodes/list_struct/list_struct.rst +++ /dev/null @@ -1,17 +0,0 @@ -************** -List Structure -************** - -.. toctree:: - :maxdepth: 2 - - list_shift - list_repeater - list_slice - list_split - list_first_last - list_item - list_reverse - list_shuffle - list_sort - list_flip \ No newline at end of file diff --git a/docs/nodes/list_struct/list_struct_index.rst b/docs/nodes/list_struct/list_struct_index.rst new file mode 100644 index 0000000000000000000000000000000000000000..3c71705762e4317e723139d261a1a4f1554b7019 --- /dev/null +++ b/docs/nodes/list_struct/list_struct_index.rst @@ -0,0 +1,17 @@ +*********** +List Struct +*********** + +.. toctree:: + :maxdepth: 2 + + flip + item + list_reverse + repeater + shift_mk2 + shuffle + slice + sort_mk2 + split + start_end diff --git a/docs/nodes/list_struct/list_repeater.rst b/docs/nodes/list_struct/repeater.rst similarity index 100% rename from docs/nodes/list_struct/list_repeater.rst rename to docs/nodes/list_struct/repeater.rst diff --git a/docs/nodes/list_struct/list_shift.rst b/docs/nodes/list_struct/shift_mk2.rst similarity index 100% rename from docs/nodes/list_struct/list_shift.rst rename to docs/nodes/list_struct/shift_mk2.rst diff --git a/docs/nodes/list_struct/list_shuffle.rst b/docs/nodes/list_struct/shuffle.rst similarity index 100% rename from docs/nodes/list_struct/list_shuffle.rst rename to docs/nodes/list_struct/shuffle.rst diff --git a/docs/nodes/list_struct/list_slice.rst b/docs/nodes/list_struct/slice.rst similarity index 100% rename from docs/nodes/list_struct/list_slice.rst rename to docs/nodes/list_struct/slice.rst diff --git a/docs/nodes/list_struct/list_sort.rst b/docs/nodes/list_struct/sort_mk2.rst similarity index 100% rename from docs/nodes/list_struct/list_sort.rst rename to docs/nodes/list_struct/sort_mk2.rst diff --git a/docs/nodes/list_struct/list_split.rst b/docs/nodes/list_struct/split.rst similarity index 100% rename from docs/nodes/list_struct/list_split.rst rename to docs/nodes/list_struct/split.rst diff --git a/docs/nodes/list_struct/list_first_last.rst b/docs/nodes/list_struct/start_end.rst similarity index 100% rename from docs/nodes/list_struct/list_first_last.rst rename to docs/nodes/list_struct/start_end.rst diff --git a/docs/nodes/logic/logic.rst b/docs/nodes/logic/logic_index.rst similarity index 82% rename from docs/nodes/logic/logic.rst rename to docs/nodes/logic/logic_index.rst index 632c693ef5990ab6cbf3becca1a6c46c3f046ee5..fe0a017be038097a25fa421a8c42e70f554dad4c 100644 --- a/docs/nodes/logic/logic.rst +++ b/docs/nodes/logic/logic_index.rst @@ -5,6 +5,6 @@ Logic .. toctree:: :maxdepth: 2 - switch logic_node - elman + neuro_elman + switch diff --git a/docs/nodes/logic/elman.rst b/docs/nodes/logic/neuro_elman.rst similarity index 100% rename from docs/nodes/logic/elman.rst rename to docs/nodes/logic/neuro_elman.rst diff --git a/docs/nodes/matrix/matrix_apply_and_join.rst b/docs/nodes/matrix/apply_and_join.rst similarity index 100% rename from docs/nodes/matrix/matrix_apply_and_join.rst rename to docs/nodes/matrix/apply_and_join.rst diff --git a/docs/nodes/matrix/matrix_deform.rst b/docs/nodes/matrix/deform.rst similarity index 100% rename from docs/nodes/matrix/matrix_deform.rst rename to docs/nodes/matrix/deform.rst diff --git a/docs/nodes/matrix/euler.rst b/docs/nodes/matrix/euler.rst new file mode 100644 index 0000000000000000000000000000000000000000..6ce56ceaf0c23878539bf95079d9afe94fa09062 --- /dev/null +++ b/docs/nodes/matrix/euler.rst @@ -0,0 +1,2 @@ +Euler +===== \ No newline at end of file diff --git a/docs/nodes/matrix/matrix_input.rst b/docs/nodes/matrix/input.rst similarity index 100% rename from docs/nodes/matrix/matrix_input.rst rename to docs/nodes/matrix/input.rst diff --git a/docs/nodes/matrix/matrix_interpolation.rst b/docs/nodes/matrix/interpolation.rst similarity index 100% rename from docs/nodes/matrix/matrix_interpolation.rst rename to docs/nodes/matrix/interpolation.rst diff --git a/docs/nodes/matrix/matrix.rst b/docs/nodes/matrix/matrix.rst deleted file mode 100644 index 6754eb8d9d382b8abf4369281a6ff51e4011099a..0000000000000000000000000000000000000000 --- a/docs/nodes/matrix/matrix.rst +++ /dev/null @@ -1,14 +0,0 @@ -****** -Matrix -****** - -.. toctree:: - :maxdepth: 2 - - matrix_apply_and_join - matrix_in_out - matrix_input - matrix_deform - matrix_shear - matrix_interpolation - diff --git a/docs/nodes/matrix/matrix_index.rst b/docs/nodes/matrix/matrix_index.rst new file mode 100644 index 0000000000000000000000000000000000000000..23038346544754fce578104e35ce1d5996689151 --- /dev/null +++ b/docs/nodes/matrix/matrix_index.rst @@ -0,0 +1,14 @@ +****** +Matrix +****** + +.. toctree:: + :maxdepth: 2 + + apply_and_join + deform + euler + input + interpolation + matrix_in_out + shear diff --git a/docs/nodes/matrix/matrix_shear.rst b/docs/nodes/matrix/shear.rst similarity index 100% rename from docs/nodes/matrix/matrix_shear.rst rename to docs/nodes/matrix/shear.rst diff --git a/docs/nodes/modifier_change/intersect_edges.rst b/docs/nodes/modifier_change/edges_intersect.rst similarity index 100% rename from docs/nodes/modifier_change/intersect_edges.rst rename to docs/nodes/modifier_change/edges_intersect.rst diff --git a/docs/nodes/modifier_change/fill_holes.rst b/docs/nodes/modifier_change/holes_fill.rst similarity index 100% rename from docs/nodes/modifier_change/fill_holes.rst rename to docs/nodes/modifier_change/holes_fill.rst diff --git a/docs/nodes/modifier_change/separate_loose_parts.rst b/docs/nodes/modifier_change/mesh_separate.rst similarity index 100% rename from docs/nodes/modifier_change/separate_loose_parts.rst rename to docs/nodes/modifier_change/mesh_separate.rst diff --git a/docs/nodes/modifier_change/modifier_change.rst b/docs/nodes/modifier_change/modifier_change_index.rst similarity index 77% rename from docs/nodes/modifier_change/modifier_change.rst rename to docs/nodes/modifier_change/modifier_change_index.rst index afc3ccba69d6f4a847190a24a52d6510382bd71b..70d3a82f5bf500ecaa183b87b01ae718720cfe76 100644 --- a/docs/nodes/modifier_change/modifier_change.rst +++ b/docs/nodes/modifier_change/modifier_change_index.rst @@ -7,20 +7,20 @@ Modifier Change bevel delete_loose - extrude_separate + edges_intersect extrude_edges extrude_edges_old - fill_holes - intersect_edges + extrude_separate + holes_fill iterate - mask_vertices mesh_join + mesh_separate objects_along_edge offset - polygon_boom + polygons_boom polygons_to_edges - triangulate - recalc_normals randomize + recalc_normals remove_doubles - separate_loose_parts + triangulate + vertices_mask diff --git a/docs/nodes/modifier_change/polygon_boom.rst b/docs/nodes/modifier_change/polygons_boom.rst similarity index 100% rename from docs/nodes/modifier_change/polygon_boom.rst rename to docs/nodes/modifier_change/polygons_boom.rst diff --git a/docs/nodes/modifier_change/mask_vertices.rst b/docs/nodes/modifier_change/vertices_mask.rst similarity index 100% rename from docs/nodes/modifier_change/mask_vertices.rst rename to docs/nodes/modifier_change/vertices_mask.rst diff --git a/docs/nodes/modifier_make/adaptative_edges.rst b/docs/nodes/modifier_make/edges_adaptative.rst similarity index 100% rename from docs/nodes/modifier_make/adaptative_edges.rst rename to docs/nodes/modifier_make/edges_adaptative.rst diff --git a/docs/nodes/modifier_make/modifier_make.rst b/docs/nodes/modifier_make/modifier_make_index.rst similarity index 73% rename from docs/nodes/modifier_make/modifier_make.rst rename to docs/nodes/modifier_make/modifier_make_index.rst index c5a465fef004151e74d61d068195f1e61c6e704c..7ce8e72e384a7045d8b12a8dbadda7901d358e6c 100644 --- a/docs/nodes/modifier_make/modifier_make.rst +++ b/docs/nodes/modifier_make/modifier_make_index.rst @@ -5,17 +5,17 @@ Modifier Make .. toctree:: :maxdepth: 2 - adaptative_edges - adaptative_polygons bisect convex_hull cross_section delaunay + edges_adaptative lathe matrix_tube pipe_tubes + polygons_adaptative solidify - uv_connection - voronoi + uv_connect + voronoi_2d wafel wireframe diff --git a/docs/nodes/modifier_make/adaptative_polygons.rst b/docs/nodes/modifier_make/polygons_adaptative.rst similarity index 100% rename from docs/nodes/modifier_make/adaptative_polygons.rst rename to docs/nodes/modifier_make/polygons_adaptative.rst diff --git a/docs/nodes/modifier_make/uv_connection.rst b/docs/nodes/modifier_make/uv_connect.rst similarity index 100% rename from docs/nodes/modifier_make/uv_connection.rst rename to docs/nodes/modifier_make/uv_connect.rst diff --git a/docs/nodes/modifier_make/voronoi.rst b/docs/nodes/modifier_make/voronoi_2d.rst similarity index 100% rename from docs/nodes/modifier_make/voronoi.rst rename to docs/nodes/modifier_make/voronoi_2d.rst diff --git a/docs/nodes/network/network_index.rst b/docs/nodes/network/network_index.rst new file mode 100644 index 0000000000000000000000000000000000000000..673ea9c6f6d9b71cd1ced3a233e36473ca395cd9 --- /dev/null +++ b/docs/nodes/network/network_index.rst @@ -0,0 +1,7 @@ +******* +Network +******* + +.. toctree:: + :maxdepth: 2 + diff --git a/docs/nodes/generator/exponential.rst b/docs/nodes/number/exponential.rst similarity index 100% rename from docs/nodes/generator/exponential.rst rename to docs/nodes/number/exponential.rst diff --git a/docs/nodes/generator/fibonacci.rst b/docs/nodes/number/fibonacci.rst similarity index 100% rename from docs/nodes/generator/fibonacci.rst rename to docs/nodes/number/fibonacci.rst diff --git a/docs/nodes/number/float2int.rst b/docs/nodes/number/float_to_int.rst similarity index 100% rename from docs/nodes/number/float2int.rst rename to docs/nodes/number/float_to_int.rst diff --git a/docs/nodes/number/formula.rst b/docs/nodes/number/formula2.rst similarity index 100% rename from docs/nodes/number/formula.rst rename to docs/nodes/number/formula2.rst diff --git a/docs/nodes/number/int.rst b/docs/nodes/number/integer.rst similarity index 100% rename from docs/nodes/number/int.rst rename to docs/nodes/number/integer.rst diff --git a/docs/nodes/number/number.rst b/docs/nodes/number/number_index.rst similarity index 55% rename from docs/nodes/number/number.rst rename to docs/nodes/number/number_index.rst index 2b8e9fab3159d60badbc7843687b1d72042ba096..3e1df7820b2125aeea601f1d1df8dae2a631e03c 100644 --- a/docs/nodes/number/number.rst +++ b/docs/nodes/number/number_index.rst @@ -5,13 +5,15 @@ Number .. toctree:: :maxdepth: 2 - range_int - range_float + exponential + fibonacci + float + float_to_int + formula2 + integer list_input random - float - int - float2int - formula - math - map_range + range_float + range_int + range_map + scalar diff --git a/docs/nodes/number/map_range.rst b/docs/nodes/number/range_map.rst similarity index 100% rename from docs/nodes/number/map_range.rst rename to docs/nodes/number/range_map.rst diff --git a/docs/nodes/number/math.rst b/docs/nodes/number/scalar.rst similarity index 100% rename from docs/nodes/number/math.rst rename to docs/nodes/number/scalar.rst diff --git a/docs/nodes/scene/get_set_properties.rst b/docs/nodes/scene/getsetprop.rst similarity index 100% rename from docs/nodes/scene/get_set_properties.rst rename to docs/nodes/scene/getsetprop.rst diff --git a/docs/nodes/scene/object_in.rst b/docs/nodes/scene/objects.rst similarity index 100% rename from docs/nodes/scene/object_in.rst rename to docs/nodes/scene/objects.rst diff --git a/docs/nodes/scene/scene.rst b/docs/nodes/scene/scene_index.rst similarity index 73% rename from docs/nodes/scene/scene.rst rename to docs/nodes/scene/scene_index.rst index 35dca808b3acc152ca5eec5a16363ddfd5adf826..0b9dadd1e136bd2e7c68640a8c957f1444794a50 100644 --- a/docs/nodes/scene/scene.rst +++ b/docs/nodes/scene/scene_index.rst @@ -5,8 +5,8 @@ Scene .. toctree:: :maxdepth: 2 - object_in + dupli_instances frame_info - get_set_properties + getsetprop + objects obj_remote - dupli_instances diff --git a/docs/nodes/text/debug.rst b/docs/nodes/text/debug_print.rst similarity index 100% rename from docs/nodes/text/debug.rst rename to docs/nodes/text/debug_print.rst diff --git a/docs/nodes/text/text.rst b/docs/nodes/text/text_index.rst similarity index 56% rename from docs/nodes/text/text.rst rename to docs/nodes/text/text_index.rst index 9375a0a5b91136ac73223e66fe239e5178a232c7..b92ef8e9bbebf7d2031c88a8ddcc1b8a683e60a7 100644 --- a/docs/nodes/text/text.rst +++ b/docs/nodes/text/text_index.rst @@ -5,11 +5,10 @@ Text .. toctree:: :maxdepth: 2 - viewer_text - note + debug_print gtext - debug - stethoscope - text_out - text_in - + note + stethoscope + text_in + text_out + viewer_text diff --git a/docs/nodes/transforms/matrix_apply.rst b/docs/nodes/transforms/apply.rst similarity index 100% rename from docs/nodes/transforms/matrix_apply.rst rename to docs/nodes/transforms/apply.rst diff --git a/docs/nodes/transforms/transforms.rst b/docs/nodes/transforms/transforms_index.rst similarity index 86% rename from docs/nodes/transforms/transforms.rst rename to docs/nodes/transforms/transforms_index.rst index 64417bab3dd1f46691eba60954c95401f3d76311..6db89823e0f888bc51d8789fe65d423a3fd7dbba 100644 --- a/docs/nodes/transforms/transforms.rst +++ b/docs/nodes/transforms/transforms_index.rst @@ -5,8 +5,8 @@ Transforms .. toctree:: :maxdepth: 2 - scale - rotation + apply mirror move - matrix_apply + rotation + scale diff --git a/docs/nodes/vector/vector_xyz.rst b/docs/nodes/vector/axis_input.rst similarity index 100% rename from docs/nodes/vector/vector_xyz.rst rename to docs/nodes/vector/axis_input.rst diff --git a/docs/nodes/vector/vector_drop.rst b/docs/nodes/vector/drop.rst similarity index 100% rename from docs/nodes/vector/vector_drop.rst rename to docs/nodes/vector/drop.rst diff --git a/docs/nodes/vector/vector_interpolation.rst b/docs/nodes/vector/interpolation_mk3.rst similarity index 100% rename from docs/nodes/vector/vector_interpolation.rst rename to docs/nodes/vector/interpolation_mk3.rst diff --git a/docs/nodes/vector/vector_evaluate.rst b/docs/nodes/vector/line_evaluate.rst similarity index 100% rename from docs/nodes/vector/vector_evaluate.rst rename to docs/nodes/vector/line_evaluate.rst diff --git a/docs/nodes/vector/vector_math.rst b/docs/nodes/vector/math.rst similarity index 100% rename from docs/nodes/vector/vector_math.rst rename to docs/nodes/vector/math.rst diff --git a/docs/nodes/vector/vector_noise.rst b/docs/nodes/vector/noise.rst similarity index 100% rename from docs/nodes/vector/vector_noise.rst rename to docs/nodes/vector/noise.rst diff --git a/docs/nodes/vector/vector.rst b/docs/nodes/vector/vector.rst deleted file mode 100644 index 4e168e1906bd56b27e1959429ec04e2b572e4ca4..0000000000000000000000000000000000000000 --- a/docs/nodes/vector/vector.rst +++ /dev/null @@ -1,19 +0,0 @@ -****** -Vector -****** - -.. toctree:: - :maxdepth: 2 - - vector_in - vector_out - vector_math - vector_drop - vector_doubles - vector_evaluate - vector_interpolation - vector_sort - vector_noise - vector_xyz - vector_polar_in - vector_polar_out \ No newline at end of file diff --git a/docs/nodes/vector/vector_index.rst b/docs/nodes/vector/vector_index.rst new file mode 100644 index 0000000000000000000000000000000000000000..31dea6a18d957f5f1d0ebb98226e66a10846a80f --- /dev/null +++ b/docs/nodes/vector/vector_index.rst @@ -0,0 +1,19 @@ +****** +Vector +****** + +.. toctree:: + :maxdepth: 2 + + axis_input + drop + interpolation_mk3 + line_evaluate + math + noise + vector_in + vector_out + vector_polar_in + vector_polar_out + vertices_delete_doubles + vertices_sort diff --git a/docs/nodes/vector/vector_doubles.rst b/docs/nodes/vector/vertices_delete_doubles.rst similarity index 100% rename from docs/nodes/vector/vector_doubles.rst rename to docs/nodes/vector/vertices_delete_doubles.rst diff --git a/docs/nodes/vector/vector_sort.rst b/docs/nodes/vector/vertices_sort.rst similarity index 100% rename from docs/nodes/vector/vector_sort.rst rename to docs/nodes/vector/vertices_sort.rst diff --git a/docs/nodes/viz/viewer_bmesh.rst b/docs/nodes/viz/viewer_bmesh_mk2.rst similarity index 100% rename from docs/nodes/viz/viewer_bmesh.rst rename to docs/nodes/viz/viewer_bmesh_mk2.rst diff --git a/docs/nodes/viz/viewer_indx.rst b/docs/nodes/viz/viewer_indices.rst similarity index 100% rename from docs/nodes/viz/viewer_indx.rst rename to docs/nodes/viz/viewer_indices.rst diff --git a/docs/nodes/viz/viewer_draw.rst b/docs/nodes/viz/viewer_mk2.rst similarity index 100% rename from docs/nodes/viz/viewer_draw.rst rename to docs/nodes/viz/viewer_mk2.rst diff --git a/docs/nodes/viz/viz.rst b/docs/nodes/viz/viz.rst deleted file mode 100644 index 764e9cd55c802c1e96eb6a91281ff44a337312d3..0000000000000000000000000000000000000000 --- a/docs/nodes/viz/viz.rst +++ /dev/null @@ -1,11 +0,0 @@ -************* -Vizualization -************* - -.. toctree:: - :maxdepth: 2 - - viewer_draw - viewer_indx - viewer_bmesh - 3dview_props diff --git a/docs/nodes/viz/viz_index.rst b/docs/nodes/viz/viz_index.rst new file mode 100644 index 0000000000000000000000000000000000000000..f47b4fecf4e22c076c5bc7847627786c8a9be3f5 --- /dev/null +++ b/docs/nodes/viz/viz_index.rst @@ -0,0 +1,11 @@ +*** +Viz +*** + +.. toctree:: + :maxdepth: 2 + + 3dview_props + viewer_bmesh_mk2 + viewer_indices + viewer_mk2 diff --git a/index.md b/index.md index dfe1a8d166d79588f354b3f6967bcb8377d781ef..06a824e40608cf90c83ddd30a66df8142291b650 100644 --- a/index.md +++ b/index.md @@ -23,7 +23,7 @@ SvBricksNode ImageNode -## Extended Generators +## Generators Extended SvBoxRoundedNode HilbertNode Hilbert3dNode @@ -99,7 +99,7 @@ ## List Mutators SvListModifierNode -## List main +## List Main ListJoinNode ZipNode ListLevelsNode @@ -109,7 +109,7 @@ ListFuncNode SvListDecomposeNode -## List struct +## List Struct ShiftNodeMK2 ListRepeaterNode ListSliceNode diff --git a/menu.py b/menu.py index cd796d966cc76ffbcc3dbe95c85877b5fba678be..b82bc9a7e99f78645b396d422d251beb38a41884 100644 --- a/menu.py +++ b/menu.py @@ -25,6 +25,8 @@ import bpy from nodeitems_utils import NodeCategory, NodeItem, NodeItemCustom import nodeitems_utils +from sverchok.utils.sv_help import build_help_remap + class SverchNodeCategory(NodeCategory): @classmethod @@ -85,10 +87,10 @@ def juggle_and_join(node_cats): # put masks into list main for ltype in ["List Masks", "List Mutators"]: node_refs = node_cats.pop(ltype) - node_cats["List main"].extend(node_refs) + node_cats["List Main"].extend(node_refs) # add extended gens to Gens menu - gen_ext = node_cats.pop("Extended Generators") + gen_ext = node_cats.pop("Generators Extended") node_cats["Generators"].extend(gen_ext) return node_cats @@ -152,6 +154,7 @@ def draw_node_ops(self,layout, context): def make_categories(): original_categories = make_node_cats() + node_cats = juggle_and_join(original_categories) node_categories = [] @@ -164,24 +167,26 @@ def make_categories(): node_count += len(nodes) node_categories.append(SverchNodeCategory("SVERCHOK_GROUPS", "Groups", items=sv_group_items)) - return node_categories, node_count - - + return node_categories, node_count, original_categories def reload_menu(): - menu, node_count = make_categories() + menu, node_count, original_categories = make_categories() if 'SVERCHOK' in nodeitems_utils._node_categories: nodeitems_utils.unregister_node_categories("SVERCHOK") nodeitems_utils.register_node_categories("SVERCHOK", menu) + + build_help_remap(original_categories) def register(): - menu, node_count = make_categories() + menu, node_count, original_categories = make_categories() if 'SVERCHOK' in nodeitems_utils._node_categories: nodeitems_utils.unregister_node_categories("SVERCHOK") nodeitems_utils.register_node_categories("SVERCHOK", menu) + build_help_remap(original_categories) + print("\n** Sverchok loaded with {i} nodes **".format(i=node_count)) diff --git a/nodes/list_basic/modifier.py b/nodes/list_basic/modifier.py index 0a1af8e07924524b7293f9c1278e6d7b643e72d8..0e00905d8967e12b7bb5a45ec7b9e38244a994b8 100644 --- a/nodes/list_basic/modifier.py +++ b/nodes/list_basic/modifier.py @@ -19,7 +19,7 @@ from itertools import accumulate import bpy -from bpy.props import EnumProperty, IntProperty, BoolProperty +from bpy.props import EnumProperty, IntProperty, BoolProperty, StringProperty from sverchok.node_tree import SverchCustomTreeNode from sverchok.data_structure import updateNode @@ -103,6 +103,7 @@ class SvListModifierNode(bpy.types.Node, SverchCustomTreeNode): update=updateNode ) + help_url = StringProperty(default='list_main/list_modifier') def draw_buttons(self, context, layout): layout.prop(self, "func_", text='') diff --git a/nodes/number/logic.py b/nodes/number/logic_node.py similarity index 100% rename from nodes/number/logic.py rename to nodes/number/logic_node.py diff --git a/ui/development.py b/ui/development.py index 34cf2907a5bda262a8ad024c535ad0a6bed02182..c4253d8f92b85e28a798b402a5add029ef44abb0 100644 --- a/ui/development.py +++ b/ui/development.py @@ -16,14 +16,17 @@ # # ##### END GPL LICENSE BLOCK ##### -import subprocess import os +from os.path import exists, isfile +import subprocess +import webbrowser import bpy from bpy.props import StringProperty, CollectionProperty, BoolProperty, FloatProperty # global variables in tools import sverchok +from sverchok.utils.sv_help import remapper BRANCH = "" @@ -77,6 +80,57 @@ class SvCopyIDName(bpy.types.Operator): return {'FINISHED'} +class SvViewHelpForNode(bpy.types.Operator): + + bl_idname = "node.view_node_help" + bl_label = "display a browser with compiled html" + kind = StringProperty(default='online') + + def execute(self, context): + n = context.active_node + + string_dir = remapper.get(n.bl_idname) + filename = n.__module__.split('.')[-1] + help_url = string_dir + '/' + filename + + # first let's find if this is a valid doc file, by inspecting locally for the rst file. + VALID = False + try: + tk = os.path.join(os.path.dirname(sverchok.__file__), 'docs', 'nodes', string_dir.replace(' ', '_'), filename + '.rst') + VALID = exists(tk) and isfile(tk) + except: + pass + + if not VALID: + self.throw_404(n) + return {'CANCELLED'} + + # valid doc link! + if self.kind == 'online': + destination = 'http://nikitron.cc.ua/sverch/html/nodes/' + help_url + '.html' + else: + basepath = os.path.dirname(sverchok.__file__) + '/docs/nodes/' + destination = r'file:///' + basepath + help_url + '.rst' + + webbrowser.open(destination) + return {'FINISHED'} + + def throw_404(self, n): + # bl_label of some nodes is edited by us, but those nodes do have docs .. + _dirname = os.path.dirname(sverchok.__file__) + path1 = os.path.join(_dirname, 'docs', '404.html') + path2 = os.path.join(_dirname, 'docs', '404_custom.html') + + with open(path1) as origin: + with open(path2, 'w') as destination: + for line in origin: + if '{{variable}}' in line: + destination.write(line.replace("{{variable}}", n.bl_label)) + else: + destination.write(line) + + webbrowser.open(path2) + def idname_draw(self, context): if not displaying_sverchok_nodes(context): @@ -88,12 +142,20 @@ def idname_draw(self, context): bl_idname = node.bl_idname layout.operator('node.copy_bl_idname', text=bl_idname + ' (copy)').name = bl_idname + # show these anyway, can fail and let us know.. + row = layout.row(align=True) + row.label('help') + row.operator('node.view_node_help', text='online').kind = 'online' + row.operator('node.view_node_help', text='offline').kind = 'offline' + + def register(): get_branch() if BRANCH: bpy.types.NODE_HT_header.append(node_show_branch) bpy.utils.register_class(SvCopyIDName) + bpy.utils.register_class(SvViewHelpForNode) bpy.types.NODE_PT_active_node_generic.append(idname_draw) @@ -101,4 +163,5 @@ def unregister(): if BRANCH: bpy.types.NODE_HT_header.remove(node_show_branch) bpy.types.NODE_PT_active_node_generic.remove(idname_draw) - bpy.utils.unregister_class(SvCopyIDName) \ No newline at end of file + bpy.utils.unregister_class(SvCopyIDName) + bpy.utils.unregister_class(SvViewHelpForNode) \ No newline at end of file diff --git a/utils/sv_help.py b/utils/sv_help.py new file mode 100644 index 0000000000000000000000000000000000000000..e6ab9ff51f49683b75a10ebd09ac115d084aa984 --- /dev/null +++ b/utils/sv_help.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +# ##### BEGIN GPL LICENSE BLOCK ##### +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# ##### END GPL LICENSE BLOCK ##### + +remapper = {} + +def build_help_remap(fdict): + for k, v in fdict.items(): + for bl_idname in v: + remapper[bl_idname[0]] = k.lower().replace('_', ' ')