From 68ee1c387218b2d01ce83b3c8a9b966e5ff470eb Mon Sep 17 00:00:00 2001 From: satabol Date: Mon, 16 Oct 2023 14:55:55 +0300 Subject: [PATCH 01/10] fix #5019 v01. Refactor "get object data" node to mk2 version. --- index.yaml | 2 +- menus/full_by_data_type.yaml | 2 +- menus/full_nortikin.yaml | 2 +- nodes/scene/get_objects_data_mk2.py | 468 ++++++++++++++++++ .../scene => old_nodes}/get_objects_data.py | 7 +- 5 files changed, 476 insertions(+), 5 deletions(-) create mode 100644 nodes/scene/get_objects_data_mk2.py rename {nodes/scene => old_nodes}/get_objects_data.py (97%) diff --git a/index.yaml b/index.yaml index 8749264fe3..fdeef479c1 100644 --- a/index.yaml +++ b/index.yaml @@ -703,7 +703,7 @@ - Scene: - icon_name: SCENE_DATA - extra_menu: ConnectionPartialMenu - - SvGetObjectsData + - SvGetObjectsDataMK2 - SvObjInLite - SvCurveInputNode - SvFCurveInNodeMK1 diff --git a/menus/full_by_data_type.yaml b/menus/full_by_data_type.yaml index 763ea4cd08..ca2e9b4591 100644 --- a/menus/full_by_data_type.yaml +++ b/menus/full_by_data_type.yaml @@ -732,7 +732,7 @@ - Scene: - icon_name: SCENE_DATA - extra_menu: ConnectionPartialMenu - - SvGetObjectsData + - SvGetObjectsDataMK2 - SvObjInLite - SvCurveInputNode - SvFCurveInNodeMK1 diff --git a/menus/full_nortikin.yaml b/menus/full_nortikin.yaml index e1c98e9ab0..80929b5f7b 100644 --- a/menus/full_nortikin.yaml +++ b/menus/full_nortikin.yaml @@ -821,7 +821,7 @@ - Scene: - icon_name: SCENE_DATA - extra_menu: ConnectionPartialMenu - - SvGetObjectsData + - SvGetObjectsDataMK2 - SvObjInLite - SvCurveInputNode - SvFCurveInNodeMK1 diff --git a/nodes/scene/get_objects_data_mk2.py b/nodes/scene/get_objects_data_mk2.py new file mode 100644 index 0000000000..24fa78b1ed --- /dev/null +++ b/nodes/scene/get_objects_data_mk2.py @@ -0,0 +1,468 @@ +# This file is part of project Sverchok. It's copyrighted by the contributors +# recorded in the version control history of the file, available from +# its original location https://github.com/nortikin/sverchok/commit/master +# +# SPDX-License-Identifier: GPL3 +# License-Filename: LICENSE + +import bpy +from bpy.props import BoolProperty, StringProperty, IntProperty +import bmesh +from mathutils import Vector, Matrix + +from sverchok.node_tree import SverchCustomTreeNode +from sverchok.utils.sv_operator_mixins import SvGenericNodeLocator +from sverchok.data_structure import updateNode +from sverchok.utils.sv_bmesh_utils import pydata_from_bmesh +from sverchok.utils.sv_mesh_utils import mesh_join +from sverchok.utils.nodes_mixins.show_3d_properties import Show3DProperties +from sverchok.utils.blender_mesh import ( + read_verts, read_edges, read_verts_normal, + read_face_normal, read_face_center, read_face_area, read_materials_idx) + + +class SvOB3BDataCollectionMK2(bpy.types.PropertyGroup): + name: bpy.props.StringProperty() + icon: bpy.props.StringProperty(default="BLANK1") + + +class ReadingObjectDataError(Exception): + pass + + +class SVOB3B_UL_NamesListMK2(bpy.types.UIList): + + def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index): + + item_icon = item.icon + if not item.icon or item.icon == "BLANK1": + try: + item_icon = 'OUTLINER_OB_' + bpy.data.objects[item.name].type + except: + item_icon = "" + + layout.label(text=item.name, icon=item_icon) + action = data.wrapper_tracked_ui_draw_op(layout, "node.sv_ob3b_collection_operator_mk2", icon='X', text='') + action.fn_name = 'REMOVE' + action.idx = index + + +class SvOB3BItemOperatorMK2(bpy.types.Operator, SvGenericNodeLocator): + + bl_idname = "node.sv_ob3b_collection_operator_mk2" + bl_label = "generic bladibla" + + fn_name: StringProperty(default='') + idx: IntProperty() + + def sv_execute(self, context, node): + if self.fn_name == 'REMOVE': + node.object_names.remove(self.idx) + node.process_node(None) + + +class SvOB3CallbackMK2(bpy.types.Operator, SvGenericNodeLocator): + + bl_idname = "node.ob3_callback_mk2" + bl_label = "Object In mk3 callback" + bl_options = {'INTERNAL'} + + fn_name: StringProperty(default='') + + def sv_execute(self, context, node): + """ + returns the operator's 'self' too to allow the code being called to + print from self.report. + """ + getattr(node, self.fn_name)(self) + + +def get_vertgroups(mesh): + return [k for k,v in enumerate(mesh.vertices) if v.groups.values()] + +numpy_socket_names = ['Vertices', 'Edges', 'Vertex Normals', 'Material Idx', 'Polygon Areas', 'Polygon Centers', 'Polygon Normals'] + + +class SvGetObjectsDataMK2(Show3DProperties, SverchCustomTreeNode, bpy.types.Node): + """ + Triggers: Object Info + Tooltip: Get Scene Objects into Sverchok Tree + """ + + bl_idname = 'SvGetObjectsDataMK2' + bl_label = 'Get Objects Data' + bl_icon = 'OUTLINER_OB_EMPTY' + sv_icon = 'SV_OBJECTS_IN' + + @property + def is_scene_dependent(self): + return (not self.inputs['Objects'].is_linked) and (self.inputs['Objects'].object_ref_pointer + or self.object_names) + + @property + def is_animation_dependent(self): + return (not self.inputs['Objects'].is_linked) and (self.inputs['Objects'].object_ref_pointer + or self.object_names) + + def hide_show_versgroups(self, context): + outs = self.outputs + showing_vg = 'Vers_grouped' in outs + + if self.vergroups and not showing_vg: + outs.new('SvStringsSocket', 'Vers_grouped') + elif not self.vergroups and showing_vg: + outs.remove(outs['Vers_grouped']) + + modifiers: BoolProperty( + name='Modifiers', + description='Apply modifier geometry to import (original untouched)', + default=False, update=updateNode) + + vergroups: BoolProperty( + name='Vergroups', + description='Use vertex groups to nesty insertion', + default=False, update=hide_show_versgroups) + + sort: BoolProperty( + name='sort by name', + description='sorting inserted objects by names', + default=True, update=updateNode) + + object_names: bpy.props.CollectionProperty(type=SvOB3BDataCollectionMK2) + + active_obj_index: bpy.props.IntProperty() + + out_np: bpy.props.BoolVectorProperty( + name="Output Numpy", + description="Output NumPy arrays (makes node faster)", + size=7, update=updateNode) + output_np_all: BoolProperty( + name='Output all numpy', + description='Output numpy arrays if possible', + default=False, update=updateNode) + + + apply_matrix: BoolProperty( + name = "Apply matrices", + description = "Apply objects matrices", + default = True, + update = updateNode) + + mesh_join : BoolProperty( + name = "merge", + description = "If checked, join mesh elements into one object", + default = False, + update = updateNode) + + def sv_init(self, context): + new = self.outputs.new + self.width = 170 + self.inputs.new('SvObjectSocket', "Objects") + new('SvVerticesSocket', "Vertices") + new('SvStringsSocket', "Edges") + new('SvStringsSocket', "Polygons") + new('SvVerticesSocket', "Vertex Normals") + new('SvStringsSocket', "Material Idx") + new('SvStringsSocket', "Polygon Areas") + new('SvVerticesSocket', "Polygon Centers") + new('SvVerticesSocket', "Polygon Normals") + new('SvMatrixSocket', "Matrix") + new('SvObjectSocket', "Object") + + + def get_objects_from_scene(self, ops): + """ + Collect selected objects + """ + self.object_names.clear() + + names = [obj.name for obj in bpy.data.objects if (obj.select_get() and len(obj.users_scene) > 0 and len(obj.users_collection) > 0)] + + if self.sort: + names.sort() + + for name in names: + item = self.object_names.add() + item.name = name + item.icon = 'OUTLINER_OB_' + bpy.data.objects[name].type + + if not self.object_names: + ops.report({'WARNING'}, "Warning, no selected objects in the scene") + return + + self.process_node(None) + + + def select_objs(self, ops): + """select all objects referenced by node""" + for item in self.object_names: + bpy.data.objects[item.name].select = True + + if not self.object_names: + ops.report({'WARNING'}, "Warning, no object associated with the obj in Node") + + + def draw_obj_names(self, layout): + if self.object_names: + layout.template_list("SVOB3B_UL_NamesListMK2", "", self, "object_names", self, "active_obj_index") + else: + layout.label(text='--None--') + + @property + def by_input(self): + return self.inputs[0].object_ref_pointer is not None or self.inputs[0].is_linked + + def sv_draw_buttons(self, context, layout): + col = layout.column(align=True) + by_input = self.by_input + if not by_input: + row = col.row() + + op_text = "Get selection" # fallback + callback = 'node.ob3_callback_mk2' + + if self.prefs_over_sized_buttons: + row.scale_y = 4.0 + op_text = "G E T" + + self.wrapper_tracked_ui_draw_op(row, callback, text=op_text).fn_name = 'get_objects_from_scene' + + col = layout.column(align=True) + row = col.row(align=True) + row.prop(self, "apply_matrix", text="Apply matrix", toggle=True) + row.prop(self, "mesh_join", text="merge", toggle=True) + + col = layout.column(align=True) + row = col.row(align=True) + if not by_input: + row.prop(self, 'sort', text='Sort', toggle=True) + row.prop(self, "modifiers", text="Post", toggle=True) + row.prop(self, "vergroups", text="VeGr", toggle=True) + if not by_input: + self.draw_obj_names(layout) + + def sv_draw_buttons_ext(self, context, layout): + r = layout.column(align=True) + row = r.row(align=True) + row.label(text="Output Numpy:") + row.prop(self, 'output_np_all', text='If possible', toggle=True) + if not self.output_np_all: + for i in range(7): + r.prop(self, "out_np", index=i, text=numpy_socket_names[i], toggle=True) + + layout.prop(self, 'draw_3dpanel', text="To Control panel") + + def rclick_menu(self, context, layout): + '''right click sv_menu items''' + layout.label(text="Output Numpy:") + layout.prop(self, 'output_np_all', text='All', toggle=True) + if not self.output_np_all: + for i in range(7): + layout.prop(self, "out_np", index=i, text=numpy_socket_names[i], toggle=True) + + def draw_buttons_3dpanel(self, layout): + if not self.by_input: + callback = 'node.ob3_callback_mk2' + row = layout.row(align=True) + row.label(text=self.label if self.label else self.name) + colo = row.row(align=True) + colo.scale_x = 1.6 + + self.wrapper_tracked_ui_draw_op(colo, callback, text='Get').fn_name = 'get_objects_from_scene' + else: + row = layout.row(align=True) + row.label(text=self.label if self.label else self.name) + self.draw_animatable_buttons(row, icon_only=True) + + def get_materials_from_bmesh(self, bm): + return [face.material_index for face in bm.faces[:]] + + def process(self): + + objs = self.inputs[0].sv_get(default=[[]]) + if not self.object_names and not objs[0]: + + return + data_objects = bpy.data.objects + outputs = self.outputs + + vers_out_grouped = [] + + o_vs, o_es, o_ps, o_vn, o_mi, o_pa, o_pc, o_pn, o_ms, o_ob = [s.is_linked for s in self.outputs[:10]] + vs, es, ps, vn, mi, pa, pc, pn, ms = [[] for s in self.outputs[:9]] + if self.modifiers: + sv_depsgraph = bpy.context.evaluated_depsgraph_get() + + out_np = self.out_np if not self.output_np_all else [True for i in range(7)] + if isinstance(objs[0], list): + objs = objs[0] + if not objs: + objs = (data_objects.get(o.name) for o in self.object_names) + + # iterate through references + for obj in objs: + + if not obj: + continue + + mtrx = obj.matrix_world + if obj.type in {'EMPTY', 'CAMERA', 'LAMP' }: + if o_ms: + ms.append(mtrx) + continue + try: + if obj.mode == 'EDIT' and obj.type == 'MESH': + # Mesh objects do not currently return what you see + # from 3dview while in edit mode when using obj.to_mesh. + me = obj.data + bm = bmesh.from_edit_mesh(me) + verts, edgs, pols = pydata_from_bmesh(bm) + + if o_vs: + if self.apply_matrix: + verts = [tuple(mtrx @ Vector(v) ) for v in verts] + vs.append(verts) + if o_es: + es.append(edgs) + if o_ps: + ps.append(pols) + if o_vn: + if self.apply_matrix: + T, R, S = mtrx.decompose() + vn.append([ tuple( R @ Vector(v.normal[:]) ) for v in bm.verts]) + else: + vn.append([v.normal[:] for v in bm.verts]) + if o_mi: + mi.append(self.get_materials_from_bmesh(bm)) + if o_pa: + pa.append([p.calc_area() for p in bm.faces]) + if o_pc: + if self.apply_matrix: + pc.append([tuple(mtrx @ Vector(p.calc_center_median()[:])) for p in bm.faces]) + else: + pc.append([p.calc_center_median()[:] for p in bm.faces]) + if o_pn: + if self.apply_matrix: + T, R, S = mtrx.decompose() + pn.append([tuple(R @ Vector(p.normal[:]) ) for p in bm.faces]) + else: + pn.append([p.normal[:] for p in bm.faces]) + + del bm + else: + + # https://developer.blender.org/T99661 + if obj.type == 'CURVE' and obj.mode == 'EDIT' and bpy.app.version[:2] == (3, 2): + raise ReadingObjectDataError("Does not support curves in edit mode in Blender 3.2") + elif self.modifiers: + obj = sv_depsgraph.objects[obj.name] + obj_data = obj.to_mesh(preserve_all_data_layers=True, depsgraph=sv_depsgraph) + else: + obj_data = obj.to_mesh() + + if o_vs: + verts = read_verts(obj_data, out_np[0]) + if self.apply_matrix: + verts = [tuple(mtrx @ Vector(v) ) for v in verts] + vs.append( verts ) + if o_es: + es.append(read_edges(obj_data, out_np[1])) + if o_ps: + ps.append([list(p.vertices) for p in obj_data.polygons]) + if self.vergroups: + vert_groups = get_vertgroups(obj_data) + vers_out_grouped.append(vert_groups) + if o_vn: + vertex_normals = read_verts_normal(obj_data, out_np[2]) + if self.apply_matrix: + T, R, S = mtrx.decompose() + vertex_normals = [tuple(R @ Vector(v) ) for v in vertex_normals] + vn.append(vertex_normals) + if o_mi: + mi.append(read_materials_idx(obj_data, out_np[3])) + if o_pa: + pa.append(read_face_area(obj_data, out_np[4])) + if o_pc: + if out_np[5]: + if self.apply_matrix: + pc.append( [tuple(mtrx @ Vector(v) ) for v in read_face_center(obj_data, output_numpy=True)] ) + else: + pc.append(read_face_center(obj_data, output_numpy=True)) + else: + if self.apply_matrix: + pc.append([ tuple( mtrx @ Vector(p.center[:]) ) for p in obj_data.polygons]) + else: + pc.append([p.center[:] for p in obj_data.polygons]) + if o_pn: + if out_np[6]: + polygon_normals = read_face_normal(obj_data, True) + if self.apply_matrix: + T, R, S = mtrx.decompose() + polygon_normals = [tuple(R @ Vector(v) ) for v in polygon_normals] + pn.append( polygon_normals) + else: + T, R, S = mtrx.decompose() + if self.apply_matrix: + pn.append([tuple(R @ Vector(p.normal[:]) ) for p in obj_data.polygons]) + #polygon_normals = [tuple(R @ Vector(v) ) for v in polygon_normals] + else: + pn.append([p.normal[:] for p in obj_data.polygons]) + + obj.to_mesh_clear() + + except ReadingObjectDataError: + raise + except Exception as err: + # it's not clear which cases this try catch should handle + # probably it should skip wrong object types + self.debug('failure in process between frozen area', self.name, err) + + if o_ms: + ms.append(mtrx) + + if self.mesh_join: + # vs, es, ps, vn, mi, pa, pc, pn, ms + offset = 0 + _vs = [] + _es, _ps, _vn, _mi, _pa, _pc, _pn, _ms = [], [], [], [], [], [], [], [] + for idx, vertices in enumerate(vs): + _vs.extend(vertices) + if es: + _es.extend( [tuple(i + offset for i in o) for o in es[idx] ] ) # edges + if ps: + _ps.extend( [tuple(i + offset for i in o) for o in ps[idx] ] ) # polygons + #_vn.extend( [tuple(i + offset for i in o) for o in ps[idx] ] ) # vers_out_grouped + if vn: + _vn.extend( vn[idx] ) # vertex normals + # _mi - materia index. I dont know what to do for a while + if mi and len(mi)>idx: + _mi.extend( mi[idx] ) + if pa: + _pa.extend( pa[idx] ) # polygon area + if pc: + _pc.extend( pc[idx] ) # polygon center + if pn: + _pn.extend( pn[idx] ) # polygon normal + if ms: + _ms.append( ms[idx] ) # matrices + + offset += len(vertices) + + vs, es, ps, vn, mi, pa, pc, pn, ms = [_vs], [_es], [_ps], [_vn], [_mi], [_pa], [_pc], [_pn], [_ms] + + for i, i2 in zip(self.outputs, [vs, es, ps, vn, mi, pa, pc, pn, ms]): + if i.is_linked: + i.sv_set(i2) + + if vers_out_grouped and vers_out_grouped[0]: + if 'Vers_grouped' in outputs and self.vergroups: + outputs['Vers_grouped'].sv_set(vers_out_grouped) + if o_ob: + if self.by_input: + outputs['Object'].sv_set(objs) + else: + outputs['Object'].sv_set([data_objects.get(o.name) for o in self.object_names]) + + +classes = [SvOB3BItemOperatorMK2, SvOB3BDataCollectionMK2, SVOB3B_UL_NamesListMK2, SvOB3CallbackMK2, SvGetObjectsDataMK2] +register, unregister = bpy.utils.register_classes_factory(classes) diff --git a/nodes/scene/get_objects_data.py b/old_nodes/get_objects_data.py similarity index 97% rename from nodes/scene/get_objects_data.py rename to old_nodes/get_objects_data.py index 469ce07a88..d0b43b35d0 100644 --- a/nodes/scene/get_objects_data.py +++ b/old_nodes/get_objects_data.py @@ -9,6 +9,8 @@ from bpy.props import BoolProperty, StringProperty, IntProperty import bmesh +#from sverchok.nodes.scene.get_objects_data_mk2 import SvOB3BDataCollectionMK2, SVOB3B_UL_NamesListMK2, SvOB3BItemOperatorMK2, SvOB3CallbackMK2 + from sverchok.node_tree import SverchCustomTreeNode from sverchok.utils.sv_operator_mixins import SvGenericNodeLocator from sverchok.data_structure import updateNode @@ -95,12 +97,12 @@ class SvGetObjectsData(Show3DProperties, SverchCustomTreeNode, bpy.types.Node): @property def is_scene_dependent(self): return (not self.inputs['Objects'].is_linked) and (self.inputs['Objects'].object_ref_pointer - or self.object_names) + or hasattr(self, 'objects_names') and self.object_names) @property def is_animation_dependent(self): return (not self.inputs['Objects'].is_linked) and (self.inputs['Objects'].object_ref_pointer - or self.object_names) + or hasattr(self, 'objects_names') and self.object_names) def hide_show_versgroups(self, context): outs = self.outputs @@ -380,4 +382,5 @@ def process(self): classes = [SvOB3BItemOperatorMK2, SvOB3BDataCollectionMK2, SVOB3B_UL_NamesListMK2, SvOB3CallbackMK2, SvGetObjectsData] +#classes = [SvGetObjectsData] register, unregister = bpy.utils.register_classes_factory(classes) From 8e9dc4a7c41be5faccdb17e359ef500b3b9dec73 Mon Sep 17 00:00:00 2001 From: satabol Date: Mon, 16 Oct 2023 18:32:27 +0300 Subject: [PATCH 02/10] fix #5019. Exclude some data from "mesh join". --- nodes/scene/get_objects_data_mk2.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/nodes/scene/get_objects_data_mk2.py b/nodes/scene/get_objects_data_mk2.py index 24fa78b1ed..48d81b5828 100644 --- a/nodes/scene/get_objects_data_mk2.py +++ b/nodes/scene/get_objects_data_mk2.py @@ -424,31 +424,33 @@ def process(self): # vs, es, ps, vn, mi, pa, pc, pn, ms offset = 0 _vs = [] - _es, _ps, _vn, _mi, _pa, _pc, _pn, _ms = [], [], [], [], [], [], [], [] + _es, _ps, _vn, _pa, _pc, _pn, _vg = [], [], [], [], [], [], [] for idx, vertices in enumerate(vs): _vs.extend(vertices) if es: - _es.extend( [tuple(i + offset for i in o) for o in es[idx] ] ) # edges + _es.extend( [[i + offset for i in o] for o in es[idx] ] ) # edges if ps: - _ps.extend( [tuple(i + offset for i in o) for o in ps[idx] ] ) # polygons + _ps.extend( [[i + offset for i in o] for o in ps[idx] ] ) # polygons #_vn.extend( [tuple(i + offset for i in o) for o in ps[idx] ] ) # vers_out_grouped if vn: _vn.extend( vn[idx] ) # vertex normals - # _mi - materia index. I dont know what to do for a while - if mi and len(mi)>idx: - _mi.extend( mi[idx] ) + # _mi - materia index. Do not change + # if mi and len(mi)>idx: + # _mi.extend( mi[idx] ) if pa: _pa.extend( pa[idx] ) # polygon area if pc: _pc.extend( pc[idx] ) # polygon center if pn: _pn.extend( pn[idx] ) # polygon normal - if ms: - _ms.append( ms[idx] ) # matrices + # if ms: Do not change + # _ms.append( ms[idx] ) # matrices + if vers_out_grouped: + _vg.extend( [ i + offset for i in vers_out_grouped[idx] ] ) # vertex groups offset += len(vertices) - vs, es, ps, vn, mi, pa, pc, pn, ms = [_vs], [_es], [_ps], [_vn], [_mi], [_pa], [_pc], [_pn], [_ms] + vs, es, ps, vn, pa, pc, pn, vers_out_grouped = [_vs], [_es], [_ps], [_vn], [_pa], [_pc], [_pn], [_vg] for i, i2 in zip(self.outputs, [vs, es, ps, vn, mi, pa, pc, pn, ms]): if i.is_linked: From c6f1fad1c871f2ab05c4d6a89ab09b43054692c8 Mon Sep 17 00:00:00 2001 From: satabol Date: Mon, 16 Oct 2023 19:18:44 +0300 Subject: [PATCH 03/10] fix #5019. Update docs and examples to the new version of get_objects_data_mk2 --- docs/nodes/scene/get_objects_data_mk2.rst | 88 +++++++++++++++++++ .../scene => old/nodes}/get_objects_data.rst | 0 .../Introduction/Adaptive_Spread.json | 4 +- 3 files changed, 90 insertions(+), 2 deletions(-) create mode 100644 docs/nodes/scene/get_objects_data_mk2.rst rename docs/{nodes/scene => old/nodes}/get_objects_data.rst (100%) diff --git a/docs/nodes/scene/get_objects_data_mk2.rst b/docs/nodes/scene/get_objects_data_mk2.rst new file mode 100644 index 0000000000..24a500097c --- /dev/null +++ b/docs/nodes/scene/get_objects_data_mk2.rst @@ -0,0 +1,88 @@ +Get Objects Data +================ + +.. image:: https://github.com/nortikin/sverchok/assets/14288520/b24e7fbc-3383-49ca-bc96-ae5ff823fee3 + :target: https://github.com/nortikin/sverchok/assets/14288520/b24e7fbc-3383-49ca-bc96-ae5ff823fee3 + +Functionality +------------- +Get objects from the Blender ``Scene`` and output them into Sverchok's node tree. This node supports most object types. All are converted to a Sverchok representation of ``Mesh`` where possible. + +A few points worth stating explicitly. + +- Empties, Cameras, and Lamps produce only matrix data. +- The order of the selected Objects can be sorted by name. +- It supports Object collections. +- It understands also ``vertex groups``, when activated, showing additional socket representing indices, that you can use for further processing. All groups are cached in one list _without_weights_. +- When you ``Get`` objects from the Scene that have modifiers on them, you can import the final mesh by enabling the ``Post`` button. +- Importing Objects with a lot of geometry will decrease Sverchok tree update speed, be careful with any modifiers that produce a lot of extra geometry (like subdivision modifier) +- The Matrix socket lets you ignore or acquire the Object's ``World Matrix``, by default the Object data is untransformed. Use a matrix-apply node if you want to explicitly transform the vertex data. + +limitations: + +- When you use the ``Post`` mode Sverchok/Blender expect Objects to be visible. If you want to "hide" the original Objects in the scene to avoid visual clutter, you can place them into a Collection and hide the collection. This is a current Blender API limitation. +- We have Bezier-in and NURBS-in nodes if you want to get Curve data from Scene objects, instead of Mesh. + +Inputs +------ + +Objects Socket + + +Parameters +---------- + ++-----------------+---------------+--------------------------------------------------------------------------+ +| Param | Type | Description | ++=================+===============+==========================================================================+ +| **G E T** | Button | Button to get selected objects from scene. | ++-----------------+---------------+--------------------------------------------------------------------------+ +| **sorting** | Bool, toggle | Sorting inserted objects by name | ++-----------------+---------------+--------------------------------------------------------------------------+ +| **post** | Bool, toggle | Postprocessing, if activated, modifiers applied to mesh before importing | ++-----------------+---------------+--------------------------------------------------------------------------+ +| **vert groups** | Bool, toggle | Import all vertex groups that in object's data. just import indexes | ++-----------------+---------------+--------------------------------------------------------------------------+ + +3D panel +-------- + +The node can show its properties on 3D panel. +For this parameter `to 3d` should be enabled, output should be linked. +After that you can press `scan for props` button on 3D panel for showing the node properties on 3D panel. + +Outputs +------- + ++------------------+--------------------------------------------------------------------------+ +| Output | Description | ++==================+==========================================================================+ +| Vertices | Vertices of objects | ++------------------+--------------------------------------------------------------------------+ +| Edges | Edges of objects | ++------------------+--------------------------------------------------------------------------+ +| Polygons | Polygons of objects | ++------------------+--------------------------------------------------------------------------+ +| Vertex Normals | Vertex Normals | ++------------------+--------------------------------------------------------------------------+ +| Material Idx | Material indexes per object face. | ++------------------+--------------------------------------------------------------------------+ +| Polygons Areas | Polygons of objects. | ++------------------+--------------------------------------------------------------------------+ +| Polygons Centers | Polygons Center of objects. | ++------------------+--------------------------------------------------------------------------+ +| Polygons Normal | Polygons Normal of objects. | ++------------------+--------------------------------------------------------------------------+ +| Matrix | Matrices of objects | ++------------------+--------------------------------------------------------------------------+ +| Vers grouped | Vertex groups' indices from all vertex groups | ++------------------+--------------------------------------------------------------------------+ + +It can output Numpy arrays of vertices and edges if enabled on N-panel properties (makes node faster) + +Examples +-------- + +.. image:: https://user-images.githubusercontent.com/619340/126961901-4c300e39-6cbe-456f-a132-104f7b3827ca.png + +Importing an object with two array modifiers applied and showing indices. diff --git a/docs/nodes/scene/get_objects_data.rst b/docs/old/nodes/get_objects_data.rst similarity index 100% rename from docs/nodes/scene/get_objects_data.rst rename to docs/old/nodes/get_objects_data.rst diff --git a/json_examples/Introduction/Adaptive_Spread.json b/json_examples/Introduction/Adaptive_Spread.json index 5d547096c2..bd8b6e43aa 100644 --- a/json_examples/Introduction/Adaptive_Spread.json +++ b/json_examples/Introduction/Adaptive_Spread.json @@ -56,7 +56,7 @@ "width": 200.0 }, "Get Objects Data": { - "bl_idname": "SvGetObjectsData", + "bl_idname": "SvGetObjectsDataMK2", "color": [ 0.0, 0.5, @@ -76,7 +76,7 @@ "width": 140.0 }, "Get Objects Data.001": { - "bl_idname": "SvGetObjectsData", + "bl_idname": "SvGetObjectsDataMK2", "color": [ 0.0, 0.5, From f86481aabf90007bba24229708bc67d97eb8998d Mon Sep 17 00:00:00 2001 From: satabol Date: Mon, 16 Oct 2023 19:24:02 +0300 Subject: [PATCH 04/10] fix #5019. Update docs and examples to the new version of get_objects_data_mk2. v002 --- json_examples/Advanced/Pineapple.zip.zip | Bin 8987 -> 9130 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/json_examples/Advanced/Pineapple.zip.zip b/json_examples/Advanced/Pineapple.zip.zip index ec40db42bd428f7ceb22b6bc07a1f417aa3824db..69dca3db0f5201467522ccecb76ed35393d45c34 100644 GIT binary patch literal 9130 zcmZ{KRZJWV5GL-f#cgrASb^g1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&y$joO%?{<^aKIm!P%(&klf2txjNS}6vLJJ z{r~iBHpPbzs&tj=3PAKUeRD+QY@JTQ%Y!1rD>H}TBB(`+`rF;a+dFk-1VjSB|KG;) jpOfW(qbuTn;QuzYs4F9*{7(nrzm)tB$Nsax00937Wddqg From b58922260dfc695563f6460e507709525c2982d9 Mon Sep 17 00:00:00 2001 From: satabol Date: Mon, 16 Oct 2023 19:29:18 +0300 Subject: [PATCH 05/10] fix #5019. Update docs refs to get_objects_data_mk2 --- docs/nodes/analyzer/raycaster_lite.rst | 2 +- docs/nodes/curve/approximate_nurbs_curve.rst | 2 +- docs/nodes/curve/bezier_spline.rst | 2 +- docs/nodes/curve/blend_curves.rst | 2 +- docs/nodes/curve/catmull_rom.rst | 12 ++++++------ docs/nodes/curve/kinky_curve.rst | 2 +- docs/nodes/curve/nurbs_curve.rst | 2 +- docs/nodes/curve/offset_mk2.rst | 8 ++++---- docs/nodes/curve/ortho_project.rst | 2 +- docs/nodes/field/mesh_surface_field.rst | 2 +- docs/nodes/modifier_change/delete_loose.rst | 2 +- docs/nodes/modifier_make/fractal_curve.rst | 2 +- docs/nodes/modifier_make/offset_line.rst | 2 +- docs/nodes/spatial/delaunay_2d_cdt.rst | 2 +- docs/nodes/transforms/transform_mesh.rst | 2 +- docs/nodes/viz/viewer_nurbs_curve.rst | 2 +- 16 files changed, 24 insertions(+), 24 deletions(-) diff --git a/docs/nodes/analyzer/raycaster_lite.rst b/docs/nodes/analyzer/raycaster_lite.rst index f7a8f14cec..04cff3195e 100644 --- a/docs/nodes/analyzer/raycaster_lite.rst +++ b/docs/nodes/analyzer/raycaster_lite.rst @@ -97,5 +97,5 @@ Usage * Scene-> :doc:`Objects In Lite ` -* Scene-> :doc:`Get Objects Data ` +* Scene-> :doc:`Get Objects Data ` diff --git a/docs/nodes/curve/approximate_nurbs_curve.rst b/docs/nodes/curve/approximate_nurbs_curve.rst index a710d13b03..9cf1189f8f 100644 --- a/docs/nodes/curve/approximate_nurbs_curve.rst +++ b/docs/nodes/curve/approximate_nurbs_curve.rst @@ -227,7 +227,7 @@ Example of the FreeCAD implementation usage. Euclidean parametrization: .. image:: https://user-images.githubusercontent.com/66558924/216157300-8480c5a9-29e4-4110-8f46-3ba15f25b3d6.jpg :target: https://user-images.githubusercontent.com/66558924/216157300-8480c5a9-29e4-4110-8f46-3ba15f25b3d6.jpg -* Scene-> :doc:`Get Objects Data ` +* Scene-> :doc:`Get Objects Data ` * Viz-> :doc:`Viewer Draw Curve ` * Text-> :doc:`Stethoscope ` diff --git a/docs/nodes/curve/bezier_spline.rst b/docs/nodes/curve/bezier_spline.rst index e1b22cb37e..7241b9eae2 100644 --- a/docs/nodes/curve/bezier_spline.rst +++ b/docs/nodes/curve/bezier_spline.rst @@ -170,7 +170,7 @@ Generic Bezier curve (of fifth order, in this case): * Vector-> :doc:`Vector sort ` * Viz-> :doc:`Viewer Draw Curve ` -* Scene-> :doc:`Get Objects Data ` +* Scene-> :doc:`Get Objects Data ` --------- diff --git a/docs/nodes/curve/blend_curves.rst b/docs/nodes/curve/blend_curves.rst index 5f2a05eb5d..460b9ebc8f 100644 --- a/docs/nodes/curve/blend_curves.rst +++ b/docs/nodes/curve/blend_curves.rst @@ -171,7 +171,7 @@ another is black - unselected); and blend them together with a smooth curve: * Vector-> :doc:`Vector sort ` * Viz-> :doc:`Viewer Draw ` * Viz-> :doc:`Viewer Draw Curve ` -* Scene-> :doc:`Get Objects Data ` +* Scene-> :doc:`Get Objects Data ` --------- diff --git a/docs/nodes/curve/catmull_rom.rst b/docs/nodes/curve/catmull_rom.rst index 2de757f13a..d3575f4217 100644 --- a/docs/nodes/curve/catmull_rom.rst +++ b/docs/nodes/curve/catmull_rom.rst @@ -125,7 +125,7 @@ Simplest example: :target: https://user-images.githubusercontent.com/284644/210108720-cb3ef5df-1745-4c19-8625-73f74a445c3d.png * Viz-> :doc:`Viewer Draw Curve ` -* Scene-> :doc:`Get Objects Data ` +* Scene-> :doc:`Get Objects Data ` Uniform (yellow) vs non-uniform (green) spline: @@ -134,7 +134,7 @@ Uniform (yellow) vs non-uniform (green) spline: * Viz-> :doc:`Viewer Draw ` * Viz-> :doc:`Viewer Draw Curve ` -* Scene-> :doc:`Get Objects Data ` +* Scene-> :doc:`Get Objects Data ` Non-uniform splines with Euclidean metric (yellow) and with centripetal metric (green): @@ -143,7 +143,7 @@ Non-uniform splines with Euclidean metric (yellow) and with centripetal metric ( * Viz-> :doc:`Viewer Draw ` * Viz-> :doc:`Viewer Draw Curve ` -* Scene-> :doc:`Get Objects Data ` +* Scene-> :doc:`Get Objects Data ` Non-uniform (Euclidean) Catmull-Rom spline (yellow) vs Cubic spline (blue): @@ -152,7 +152,7 @@ Non-uniform (Euclidean) Catmull-Rom spline (yellow) vs Cubic spline (blue): * Viz-> :doc:`Viewer Draw ` * Viz-> :doc:`Viewer Draw Curve ` -* Scene-> :doc:`Get Objects Data ` +* Scene-> :doc:`Get Objects Data ` Uniform splines with different tension values: from 0.2 (almost black lines) to 2.0 (white line): @@ -165,7 +165,7 @@ Uniform splines with different tension values: from 0.2 (almost black lines) to * List->List Struct-> :doc:`List Levels ` * Color-> :doc:`Color In ` * Viz-> :doc:`Viewer Draw ` -* Scene-> :doc:`Get Objects Data ` +* Scene-> :doc:`Get Objects Data ` Here the curvature comb is used to illustrate that the curvature of Catmull-Rom splines can change very fast and sudden: @@ -175,5 +175,5 @@ splines can change very fast and sudden: * Viz-> :doc:`Viewer Draw ` * Viz-> :doc:`Viewer Draw Curve ` -* Scene-> :doc:`Get Objects Data ` +* Scene-> :doc:`Get Objects Data ` diff --git a/docs/nodes/curve/kinky_curve.rst b/docs/nodes/curve/kinky_curve.rst index 2f72052e83..f85f249dcd 100644 --- a/docs/nodes/curve/kinky_curve.rst +++ b/docs/nodes/curve/kinky_curve.rst @@ -101,7 +101,7 @@ A simple example: * Matrix-> :doc:`Matrix In ` * Viz-> :doc:`Viewer Draw Curve ` * Viz-> :doc:`Viewer Index+ ` -* Scene-> :doc:`Get Objects Data ` +* Scene-> :doc:`Get Objects Data ` --------- diff --git a/docs/nodes/curve/nurbs_curve.rst b/docs/nodes/curve/nurbs_curve.rst index b1e79d43b4..6b41f7aad7 100644 --- a/docs/nodes/curve/nurbs_curve.rst +++ b/docs/nodes/curve/nurbs_curve.rst @@ -135,4 +135,4 @@ Updated example: * Number-> :doc:`List Input ` * Vector-> :doc:`Vector sort ` * Viz-> :doc:`Viewer Draw Curve ` -* Scene-> :doc:`Get Objects Data ` \ No newline at end of file +* Scene-> :doc:`Get Objects Data ` \ No newline at end of file diff --git a/docs/nodes/curve/offset_mk2.rst b/docs/nodes/curve/offset_mk2.rst index 8a35298e96..b145362c22 100644 --- a/docs/nodes/curve/offset_mk2.rst +++ b/docs/nodes/curve/offset_mk2.rst @@ -235,7 +235,7 @@ Offset one curve with several different offset amounts: * Number-> :doc:`Number Range ` * Vector-> :doc:`Vector sort ` * Viz-> :doc:`Viewer Draw ` -* Scene-> :doc:`Get Objects Data ` +* Scene-> :doc:`Get Objects Data ` --------- @@ -249,7 +249,7 @@ Example of **Custom (N/B/T)** mode usage: * Number-> :doc:`Number Range ` * Vector-> :doc:`Vector sort ` * Vector-> :doc:`Vector Polar Input ` -* Scene-> :doc:`Get Objects Data ` +* Scene-> :doc:`Get Objects Data ` * Viz-> :doc:`Viewer Draw ` --------- @@ -272,7 +272,7 @@ the tangent of original curve is perpendicular to offset operation plane. * Number-> :doc:`A Number ` * Vector-> :doc:`Vector sort ` * List->List Struct-> :doc:`List Item ` -* Scene-> :doc:`Get Objects Data ` +* Scene-> :doc:`Get Objects Data ` * Text-> :doc:`Stethoscope ` * Viz-> :doc:`Viewer Draw ` @@ -293,7 +293,7 @@ Example of **Variable** offset mode usage: * Number-> :doc:`A Number ` * Vector-> :doc:`Vector sort ` * List->List Struct-> :doc:`List Item ` -* Scene-> :doc:`Get Objects Data ` +* Scene-> :doc:`Get Objects Data ` * Text-> :doc:`Stethoscope ` * Viz-> :doc:`Viewer Draw ` diff --git a/docs/nodes/curve/ortho_project.rst b/docs/nodes/curve/ortho_project.rst index 1e08dbbf2b..2970b46d87 100644 --- a/docs/nodes/curve/ortho_project.rst +++ b/docs/nodes/curve/ortho_project.rst @@ -92,4 +92,4 @@ Take points on a straight line and project them to some curve: * Transform-> :doc:`Matrix Apply (verts) ` * Viz-> :doc:`Viewer Draw ` * Scene-> :doc:`Bezier Input ` -* Scene-> :doc:`Get Objects Data ` \ No newline at end of file +* Scene-> :doc:`Get Objects Data ` \ No newline at end of file diff --git a/docs/nodes/field/mesh_surface_field.rst b/docs/nodes/field/mesh_surface_field.rst index 498922eb06..fb6e94cb7d 100644 --- a/docs/nodes/field/mesh_surface_field.rst +++ b/docs/nodes/field/mesh_surface_field.rst @@ -41,7 +41,7 @@ With real mesh you can get very funny results: * Surfaces-> :doc:`Marching Cubes ` * Matrix-> :doc:`Matrix Apply to Mesh ` * Viz-> :doc:`Viewer Draw ` -* Scene-> :doc:`Get Objects Data ` +* Scene-> :doc:`Get Objects Data ` Inputs ------ diff --git a/docs/nodes/modifier_change/delete_loose.rst b/docs/nodes/modifier_change/delete_loose.rst index 89a8315a46..ec25862aed 100644 --- a/docs/nodes/modifier_change/delete_loose.rst +++ b/docs/nodes/modifier_change/delete_loose.rst @@ -32,6 +32,6 @@ Simple: .. image:: https://user-images.githubusercontent.com/14288520/199108536-900db4f5-4347-48fe-8ccc-5dbb748c188b.png :target: https://user-images.githubusercontent.com/14288520/199108536-900db4f5-4347-48fe-8ccc-5dbb748c188b.png -* Scene-> :doc:`Get Objects Data ` +* Scene-> :doc:`Get Objects Data ` * Viz-> :doc:`Viewer Draw ` * Text-> :doc:`Stethoscope ` \ No newline at end of file diff --git a/docs/nodes/modifier_make/fractal_curve.rst b/docs/nodes/modifier_make/fractal_curve.rst index 91f7b9c3dc..69ca4dafa5 100644 --- a/docs/nodes/modifier_make/fractal_curve.rst +++ b/docs/nodes/modifier_make/fractal_curve.rst @@ -102,5 +102,5 @@ Vectorization example: * Number-> :doc:`List Input ` * Modifiers->Modifier Make-> :doc:`UV Connection ` * Vector-> :doc:`Vector sort ` -* Scene-> :doc:`Get Objects Data ` +* Scene-> :doc:`Get Objects Data ` * Viz-> :doc:`Viewer Draw ` \ No newline at end of file diff --git a/docs/nodes/modifier_make/offset_line.rst b/docs/nodes/modifier_make/offset_line.rst index 583f49dcb4..1c0967a05d 100644 --- a/docs/nodes/modifier_make/offset_line.rst +++ b/docs/nodes/modifier_make/offset_line.rst @@ -105,6 +105,6 @@ Using of Z coordinate: .. image:: https://user-images.githubusercontent.com/14288520/200909050-34199e42-54aa-41cf-9efb-abef230afdf7.png :target: https://user-images.githubusercontent.com/14288520/200909050-34199e42-54aa-41cf-9efb-abef230afdf7.png -* Scene-> :doc:`Get Objects Data ` +* Scene-> :doc:`Get Objects Data ` * Matrix-> :doc:`Matrix In ` * Viz-> :doc:`Viewer Draw ` \ No newline at end of file diff --git a/docs/nodes/spatial/delaunay_2d_cdt.rst b/docs/nodes/spatial/delaunay_2d_cdt.rst index 1c1efd66e9..05447be7f5 100644 --- a/docs/nodes/spatial/delaunay_2d_cdt.rst +++ b/docs/nodes/spatial/delaunay_2d_cdt.rst @@ -84,7 +84,7 @@ Examples .. image:: https://user-images.githubusercontent.com/14288520/202170634-f26119f8-bf1c-41a6-881e-cf1d4fdf3739.png :target: https://user-images.githubusercontent.com/14288520/202170634-f26119f8-bf1c-41a6-881e-cf1d4fdf3739.png -* Scene-> :doc:`Get Objects Data ` +* Scene-> :doc:`Get Objects Data ` * Spatial-> :doc:`Populate Mesh ` * List->List Main-> :doc:`List Join ` * Viz-> :doc:`Viewer Draw ` diff --git a/docs/nodes/transforms/transform_mesh.rst b/docs/nodes/transforms/transform_mesh.rst index f642b71b3f..861338694a 100644 --- a/docs/nodes/transforms/transform_mesh.rst +++ b/docs/nodes/transforms/transform_mesh.rst @@ -161,5 +161,5 @@ Examples * Generator-> :doc:`Suzanne ` * Matrix-> :doc:`Matrix Out ` -* Scene-> :doc:`Get Objects Data ` +* Scene-> :doc:`Get Objects Data ` * Analyzers-> :doc:`Select Mesh Elements ` \ No newline at end of file diff --git a/docs/nodes/viz/viewer_nurbs_curve.rst b/docs/nodes/viz/viewer_nurbs_curve.rst index c876256a20..96514d312c 100644 --- a/docs/nodes/viz/viewer_nurbs_curve.rst +++ b/docs/nodes/viz/viewer_nurbs_curve.rst @@ -61,4 +61,4 @@ Examples of usage .. image:: https://user-images.githubusercontent.com/14288520/190427453-6d1dcb65-e0ce-4194-9860-d1faf4df478b.png :target: https://user-images.githubusercontent.com/14288520/190427453-6d1dcb65-e0ce-4194-9860-d1faf4df478b.png -* Scene-> :doc:`Get Objects Data ` \ No newline at end of file +* Scene-> :doc:`Get Objects Data ` \ No newline at end of file From 7b91510ca940117bc586e62cc60271bc595d709f Mon Sep 17 00:00:00 2001 From: satabol Date: Mon, 16 Oct 2023 19:49:00 +0300 Subject: [PATCH 06/10] fix #5019. Update docs refs to get_objects_data_mk2. v002 --- docs/old/nodes/get_objects_data.rst | 85 ----------------------------- 1 file changed, 85 deletions(-) delete mode 100644 docs/old/nodes/get_objects_data.rst diff --git a/docs/old/nodes/get_objects_data.rst b/docs/old/nodes/get_objects_data.rst deleted file mode 100644 index f6a8e2bc9c..0000000000 --- a/docs/old/nodes/get_objects_data.rst +++ /dev/null @@ -1,85 +0,0 @@ -Get Objects Data -================ - -Functionality -------------- -Get objects from the Blender ``Scene`` and output them into Sverchok's node tree. This node supports most object types. All are converted to a Sverchok representation of ``Mesh`` where possible. - -A few points worth stating explicitly. - -- Empties, Cameras, and Lamps produce only matrix data. -- The order of the selected Objects can be sorted by name. -- It supports Object collections. -- It understands also ``vertex groups``, when activated, showing additional socket representing indices, that you can use for further processing. All groups are cached in one list _without_weights_. -- When you ``Get`` objects from the Scene that have modifiers on them, you can import the final mesh by enabling the ``Post`` button. -- Importing Objects with a lot of geometry will decrease Sverchok tree update speed, be careful with any modifiers that produce a lot of extra geometry (like subdivision modifier) -- The Matrix socket lets you ignore or acquire the Object's ``World Matrix``, by default the Object data is untransformed. Use a matrix-apply node if you want to explicitly transform the vertex data. - -limitations: - -- When you use the ``Post`` mode Sverchok/Blender expect Objects to be visible. If you want to "hide" the original Objects in the scene to avoid visual clutter, you can place them into a Collection and hide the collection. This is a current Blender API limitation. -- We have Bezier-in and NURBS-in nodes if you want to get Curve data from Scene objects, instead of Mesh. - -Inputs ------- - -Objects Socket - - -Parameters ----------- - -+-----------------+---------------+--------------------------------------------------------------------------+ -| Param | Type | Description | -+=================+===============+==========================================================================+ -| **G E T** | Button | Button to get selected objects from scene. | -+-----------------+---------------+--------------------------------------------------------------------------+ -| **sorting** | Bool, toggle | Sorting inserted objects by name | -+-----------------+---------------+--------------------------------------------------------------------------+ -| **post** | Bool, toggle | Postprocessing, if activated, modifiers applied to mesh before importing | -+-----------------+---------------+--------------------------------------------------------------------------+ -| **vert groups** | Bool, toggle | Import all vertex groups that in object's data. just import indexes | -+-----------------+---------------+--------------------------------------------------------------------------+ - -3D panel --------- - -The node can show its properties on 3D panel. -For this parameter `to 3d` should be enabled, output should be linked. -After that you can press `scan for props` button on 3D panel for showing the node properties on 3D panel. - -Outputs -------- - -+------------------+--------------------------------------------------------------------------+ -| Output | Description | -+==================+==========================================================================+ -| Vertices | Vertices of objects | -+------------------+--------------------------------------------------------------------------+ -| Edges | Edges of objects | -+------------------+--------------------------------------------------------------------------+ -| Polygons | Polygons of objects | -+------------------+--------------------------------------------------------------------------+ -| Vertex Normals | Vertex Normals | -+------------------+--------------------------------------------------------------------------+ -| Material Idx | Material indexes per object face. | -+------------------+--------------------------------------------------------------------------+ -| Polygons Areas | Polygons of objects. | -+------------------+--------------------------------------------------------------------------+ -| Polygons Centers | Polygons Center of objects. | -+------------------+--------------------------------------------------------------------------+ -| Polygons Normal | Polygons Normal of objects. | -+------------------+--------------------------------------------------------------------------+ -| Matrix | Matrices of objects | -+------------------+--------------------------------------------------------------------------+ -| Vers grouped | Vertex groups' indices from all vertex groups | -+------------------+--------------------------------------------------------------------------+ - -It can output Numpy arrays of vertices and edges if enabled on N-panel properties (makes node faster) - -Examples --------- - -.. image:: https://user-images.githubusercontent.com/619340/126961901-4c300e39-6cbe-456f-a132-104f7b3827ca.png - -Importing an object with two array modifiers applied and showing indices. From f7fb4b12c57736c24baf4a6cd6aa17f58c19c141 Mon Sep 17 00:00:00 2001 From: satabol Date: Tue, 17 Oct 2023 14:46:30 +0300 Subject: [PATCH 07/10] fix #5019. Update docs refs to get_objects_data_mk2. v003 Save doc for old nodes docs/old/nodes/get_objects_data.rst --- docs/old/nodes/get_objects_data.rst | 90 +++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 docs/old/nodes/get_objects_data.rst diff --git a/docs/old/nodes/get_objects_data.rst b/docs/old/nodes/get_objects_data.rst new file mode 100644 index 0000000000..e9a302f18b --- /dev/null +++ b/docs/old/nodes/get_objects_data.rst @@ -0,0 +1,90 @@ +:orphan: + +Get Objects Data +================ + +.. image:: https://github.com/nortikin/sverchok/assets/14288520/b24e7fbc-3383-49ca-bc96-ae5ff823fee3 + :target: https://github.com/nortikin/sverchok/assets/14288520/b24e7fbc-3383-49ca-bc96-ae5ff823fee3 + +Functionality +------------- +Get objects from the Blender ``Scene`` and output them into Sverchok's node tree. This node supports most object types. All are converted to a Sverchok representation of ``Mesh`` where possible. + +A few points worth stating explicitly. + +- Empties, Cameras, and Lamps produce only matrix data. +- The order of the selected Objects can be sorted by name. +- It supports Object collections. +- It understands also ``vertex groups``, when activated, showing additional socket representing indices, that you can use for further processing. All groups are cached in one list _without_weights_. +- When you ``Get`` objects from the Scene that have modifiers on them, you can import the final mesh by enabling the ``Post`` button. +- Importing Objects with a lot of geometry will decrease Sverchok tree update speed, be careful with any modifiers that produce a lot of extra geometry (like subdivision modifier) +- The Matrix socket lets you ignore or acquire the Object's ``World Matrix``, by default the Object data is untransformed. Use a matrix-apply node if you want to explicitly transform the vertex data. + +limitations: + +- When you use the ``Post`` mode Sverchok/Blender expect Objects to be visible. If you want to "hide" the original Objects in the scene to avoid visual clutter, you can place them into a Collection and hide the collection. This is a current Blender API limitation. +- We have Bezier-in and NURBS-in nodes if you want to get Curve data from Scene objects, instead of Mesh. + +Inputs +------ + +Objects Socket + + +Parameters +---------- + ++-----------------+---------------+--------------------------------------------------------------------------+ +| Param | Type | Description | ++=================+===============+==========================================================================+ +| **G E T** | Button | Button to get selected objects from scene. | ++-----------------+---------------+--------------------------------------------------------------------------+ +| **sorting** | Bool, toggle | Sorting inserted objects by name | ++-----------------+---------------+--------------------------------------------------------------------------+ +| **post** | Bool, toggle | Postprocessing, if activated, modifiers applied to mesh before importing | ++-----------------+---------------+--------------------------------------------------------------------------+ +| **vert groups** | Bool, toggle | Import all vertex groups that in object's data. just import indexes | ++-----------------+---------------+--------------------------------------------------------------------------+ + +3D panel +-------- + +The node can show its properties on 3D panel. +For this parameter `to 3d` should be enabled, output should be linked. +After that you can press `scan for props` button on 3D panel for showing the node properties on 3D panel. + +Outputs +------- + ++------------------+--------------------------------------------------------------------------+ +| Output | Description | ++==================+==========================================================================+ +| Vertices | Vertices of objects | ++------------------+--------------------------------------------------------------------------+ +| Edges | Edges of objects | ++------------------+--------------------------------------------------------------------------+ +| Polygons | Polygons of objects | ++------------------+--------------------------------------------------------------------------+ +| Vertex Normals | Vertex Normals | ++------------------+--------------------------------------------------------------------------+ +| Material Idx | Material indexes per object face. | ++------------------+--------------------------------------------------------------------------+ +| Polygons Areas | Polygons of objects. | ++------------------+--------------------------------------------------------------------------+ +| Polygons Centers | Polygons Center of objects. | ++------------------+--------------------------------------------------------------------------+ +| Polygons Normal | Polygons Normal of objects. | ++------------------+--------------------------------------------------------------------------+ +| Matrix | Matrices of objects | ++------------------+--------------------------------------------------------------------------+ +| Vers grouped | Vertex groups' indices from all vertex groups | ++------------------+--------------------------------------------------------------------------+ + +It can output Numpy arrays of vertices and edges if enabled on N-panel properties (makes node faster) + +Examples +-------- + +.. image:: https://user-images.githubusercontent.com/619340/126961901-4c300e39-6cbe-456f-a132-104f7b3827ca.png + +Importing an object with two array modifiers applied and showing indices. From ed72b5dbad9d6b4f2b55e1961f5c272e8092719f Mon Sep 17 00:00:00 2001 From: satabol Date: Tue, 17 Oct 2023 19:26:13 +0300 Subject: [PATCH 08/10] fix #5019 extend node "get object data" with options "apply matrix" and "join mesh" (merge). Append switching to numpy. --- ...bjects_data_mk2.py => get_objects_data.py} | 132 ++++++++++-------- 1 file changed, 70 insertions(+), 62 deletions(-) rename nodes/scene/{get_objects_data_mk2.py => get_objects_data.py} (78%) diff --git a/nodes/scene/get_objects_data_mk2.py b/nodes/scene/get_objects_data.py similarity index 78% rename from nodes/scene/get_objects_data_mk2.py rename to nodes/scene/get_objects_data.py index 48d81b5828..2d6c9a7871 100644 --- a/nodes/scene/get_objects_data_mk2.py +++ b/nodes/scene/get_objects_data.py @@ -19,6 +19,7 @@ from sverchok.utils.blender_mesh import ( read_verts, read_edges, read_verts_normal, read_face_normal, read_face_center, read_face_area, read_materials_idx) +import numpy as np class SvOB3BDataCollectionMK2(bpy.types.PropertyGroup): @@ -316,37 +317,24 @@ def process(self): # from 3dview while in edit mode when using obj.to_mesh. me = obj.data bm = bmesh.from_edit_mesh(me) - verts, edgs, pols = pydata_from_bmesh(bm) + # verts, edgs, pols = pydata_from_bmesh(bm) if o_vs: - if self.apply_matrix: - verts = [tuple(mtrx @ Vector(v) ) for v in verts] - vs.append(verts) + verts = [ Vector(v.co) for v in bm.verts] # v.co is a Vector() if o_es: - es.append(edgs) + edgs = [[e.verts[0].index, e.verts[1].index] for e in bm.edges] if o_ps: - ps.append(pols) + pols = [[i.index for i in p.verts] for p in bm.faces] if o_vn: - if self.apply_matrix: - T, R, S = mtrx.decompose() - vn.append([ tuple( R @ Vector(v.normal[:]) ) for v in bm.verts]) - else: - vn.append([v.normal[:] for v in bm.verts]) + vertex_normals = [ Vector(v.normal) for v in bm.verts] # v.normal is a Vector() if o_mi: - mi.append(self.get_materials_from_bmesh(bm)) + material_indexes = self.get_materials_from_bmesh(bm) if o_pa: - pa.append([p.calc_area() for p in bm.faces]) + polygons_areas = [ p.calc_area() for p in bm.faces ] if o_pc: - if self.apply_matrix: - pc.append([tuple(mtrx @ Vector(p.calc_center_median()[:])) for p in bm.faces]) - else: - pc.append([p.calc_center_median()[:] for p in bm.faces]) + polygon_centers = [ Vector(p.calc_center_median()) for p in bm.faces ] if o_pn: - if self.apply_matrix: - T, R, S = mtrx.decompose() - pn.append([tuple(R @ Vector(p.normal[:]) ) for p in bm.faces]) - else: - pn.append([p.normal[:] for p in bm.faces]) + polygon_normals = [ Vector(p.normal) for p in bm.faces ] del bm else: @@ -361,54 +349,55 @@ def process(self): obj_data = obj.to_mesh() if o_vs: - verts = read_verts(obj_data, out_np[0]) - if self.apply_matrix: - verts = [tuple(mtrx @ Vector(v) ) for v in verts] - vs.append( verts ) + verts = [ Vector(v.co) for v in obj_data.vertices] # v.co is a Vector() if o_es: - es.append(read_edges(obj_data, out_np[1])) + edgs = [[ e.vertices[0], e.vertices[1] ] for e in obj_data.edges] if o_ps: - ps.append([list(p.vertices) for p in obj_data.polygons]) + pols = [list(p.vertices) for p in obj_data.polygons] if self.vergroups: - vert_groups = get_vertgroups(obj_data) - vers_out_grouped.append(vert_groups) + vert_groups = get_vertgroups(obj_data) if o_vn: - vertex_normals = read_verts_normal(obj_data, out_np[2]) - if self.apply_matrix: - T, R, S = mtrx.decompose() - vertex_normals = [tuple(R @ Vector(v) ) for v in vertex_normals] - vn.append(vertex_normals) + vertex_normals = [ Vector(v.normal) for v in obj_data.vertices ] # v.normal is a Vector(). Update. Blender 3.6.3 crash in no wrap Vector(v.normal). I think this is after line "obj.to_mesh_clear()" if o_mi: - mi.append(read_materials_idx(obj_data, out_np[3])) + material_indexes = read_materials_idx(obj_data, out_np[3]) if o_pa: - pa.append(read_face_area(obj_data, out_np[4])) + polygons_areas = [ polygon.area for polygon in obj_data.polygons] if o_pc: - if out_np[5]: - if self.apply_matrix: - pc.append( [tuple(mtrx @ Vector(v) ) for v in read_face_center(obj_data, output_numpy=True)] ) - else: - pc.append(read_face_center(obj_data, output_numpy=True)) - else: - if self.apply_matrix: - pc.append([ tuple( mtrx @ Vector(p.center[:]) ) for p in obj_data.polygons]) - else: - pc.append([p.center[:] for p in obj_data.polygons]) + polygon_centers = [ Vector(polygon.center) for polygon in obj_data.polygons] if o_pn: - if out_np[6]: - polygon_normals = read_face_normal(obj_data, True) - if self.apply_matrix: - T, R, S = mtrx.decompose() - polygon_normals = [tuple(R @ Vector(v) ) for v in polygon_normals] - pn.append( polygon_normals) - else: - T, R, S = mtrx.decompose() - if self.apply_matrix: - pn.append([tuple(R @ Vector(p.normal[:]) ) for p in obj_data.polygons]) - #polygon_normals = [tuple(R @ Vector(v) ) for v in polygon_normals] - else: - pn.append([p.normal[:] for p in obj_data.polygons]) - - obj.to_mesh_clear() + polygon_normals = [ Vector(polygon.normal) for polygon in obj_data.polygons ] + + obj.to_mesh_clear() + + if self.apply_matrix: + if o_vs: + verts = [ tuple(mtrx @ v ) for v in verts ] + T, R, S = mtrx.decompose() + if o_vn: + vertex_normals = [ tuple( R @ vertex_normal ) for vertex_normal in vertex_normals ] + if o_pc: + polygon_centers = [ tuple( mtrx @ polygon_center) for polygon_center in polygon_centers ] + if o_pn: + polygon_normals = [ tuple( R @ polygon_normal) for polygon_normal in polygon_normals ] + + if o_vs: + vs.append( verts ) + if o_es: + es.append( edgs ) + if o_ps: + ps.append( pols ) + if self.vergroups: + vers_out_grouped.append( vert_groups ) + if o_vn: + vn.append( vertex_normals ) + if o_mi: + mi.append( material_indexes ) + if o_pa: + pa.append( polygons_areas ) + if o_pc: + pc.append( polygon_centers ) + if o_pn: + pn.append( polygon_normals ) except ReadingObjectDataError: raise @@ -452,6 +441,25 @@ def process(self): vs, es, ps, vn, pa, pc, pn, vers_out_grouped = [_vs], [_es], [_ps], [_vn], [_pa], [_pc], [_pn], [_vg] + if o_vs and (out_np[0]): + vs = [np.array(vert) for vert in vs] + if o_es and (out_np[1]): + es = [np.array(edge) for edge in es] + # if o_ps and (out_np[2]): + # ps = [np.array(pol) for pol in ps] + # if self.vergroups: + # vers_out_grouped = [np.array(group) for group in vers_out_grouped] + if o_vn and (out_np[2]): + vn = [np.array(vert_normal) for vert_normal in vn] + if o_mi and (out_np[3]): + mi = [np.array(material_index) for material_index in mi] + if o_pa and (out_np[4]): + pa = [np.array(polygon_areas) for polygon_areas in pa] + if o_pc and (out_np[5]): + pc = [np.array(polygon_centers) for polygon_centers in pc] + if o_pn and (out_np[6]): + pn = [np.array(polygon_normals) for polygon_normals in pn] + for i, i2 in zip(self.outputs, [vs, es, ps, vn, mi, pa, pc, pn, ms]): if i.is_linked: i.sv_set(i2) From 0f5d6ccfacab8e4e05de05067c63338c9f0e98b5 Mon Sep 17 00:00:00 2001 From: satabol Date: Tue, 17 Oct 2023 19:47:21 +0300 Subject: [PATCH 09/10] fix #5019 Extend node "Get object data" with options "apply matrix" and "join mesh" (merge). fix docs. --- docs/nodes/analyzer/raycaster_lite.rst | 2 +- docs/nodes/curve/approximate_nurbs_curve.rst | 2 +- docs/nodes/curve/bezier_spline.rst | 2 +- docs/nodes/curve/blend_curves.rst | 2 +- docs/nodes/curve/catmull_rom.rst | 12 ++++++------ docs/nodes/curve/kinky_curve.rst | 2 +- docs/nodes/curve/nurbs_curve.rst | 2 +- docs/nodes/curve/offset_mk2.rst | 8 ++++---- docs/nodes/curve/ortho_project.rst | 2 +- docs/nodes/field/mesh_surface_field.rst | 2 +- docs/nodes/modifier_change/delete_loose.rst | 2 +- docs/nodes/modifier_make/fractal_curve.rst | 2 +- docs/nodes/modifier_make/offset_line.rst | 2 +- ...get_objects_data_mk2.rst => get_objects_data.rst} | 0 docs/nodes/spatial/delaunay_2d_cdt.rst | 2 +- docs/nodes/transforms/transform_mesh.rst | 2 +- docs/nodes/viz/viewer_nurbs_curve.rst | 2 +- 17 files changed, 24 insertions(+), 24 deletions(-) rename docs/nodes/scene/{get_objects_data_mk2.rst => get_objects_data.rst} (100%) diff --git a/docs/nodes/analyzer/raycaster_lite.rst b/docs/nodes/analyzer/raycaster_lite.rst index 04cff3195e..f7a8f14cec 100644 --- a/docs/nodes/analyzer/raycaster_lite.rst +++ b/docs/nodes/analyzer/raycaster_lite.rst @@ -97,5 +97,5 @@ Usage * Scene-> :doc:`Objects In Lite ` -* Scene-> :doc:`Get Objects Data ` +* Scene-> :doc:`Get Objects Data ` diff --git a/docs/nodes/curve/approximate_nurbs_curve.rst b/docs/nodes/curve/approximate_nurbs_curve.rst index 9cf1189f8f..a710d13b03 100644 --- a/docs/nodes/curve/approximate_nurbs_curve.rst +++ b/docs/nodes/curve/approximate_nurbs_curve.rst @@ -227,7 +227,7 @@ Example of the FreeCAD implementation usage. Euclidean parametrization: .. image:: https://user-images.githubusercontent.com/66558924/216157300-8480c5a9-29e4-4110-8f46-3ba15f25b3d6.jpg :target: https://user-images.githubusercontent.com/66558924/216157300-8480c5a9-29e4-4110-8f46-3ba15f25b3d6.jpg -* Scene-> :doc:`Get Objects Data ` +* Scene-> :doc:`Get Objects Data ` * Viz-> :doc:`Viewer Draw Curve ` * Text-> :doc:`Stethoscope ` diff --git a/docs/nodes/curve/bezier_spline.rst b/docs/nodes/curve/bezier_spline.rst index 7241b9eae2..e1b22cb37e 100644 --- a/docs/nodes/curve/bezier_spline.rst +++ b/docs/nodes/curve/bezier_spline.rst @@ -170,7 +170,7 @@ Generic Bezier curve (of fifth order, in this case): * Vector-> :doc:`Vector sort ` * Viz-> :doc:`Viewer Draw Curve ` -* Scene-> :doc:`Get Objects Data ` +* Scene-> :doc:`Get Objects Data ` --------- diff --git a/docs/nodes/curve/blend_curves.rst b/docs/nodes/curve/blend_curves.rst index 460b9ebc8f..5f2a05eb5d 100644 --- a/docs/nodes/curve/blend_curves.rst +++ b/docs/nodes/curve/blend_curves.rst @@ -171,7 +171,7 @@ another is black - unselected); and blend them together with a smooth curve: * Vector-> :doc:`Vector sort ` * Viz-> :doc:`Viewer Draw ` * Viz-> :doc:`Viewer Draw Curve ` -* Scene-> :doc:`Get Objects Data ` +* Scene-> :doc:`Get Objects Data ` --------- diff --git a/docs/nodes/curve/catmull_rom.rst b/docs/nodes/curve/catmull_rom.rst index d3575f4217..2de757f13a 100644 --- a/docs/nodes/curve/catmull_rom.rst +++ b/docs/nodes/curve/catmull_rom.rst @@ -125,7 +125,7 @@ Simplest example: :target: https://user-images.githubusercontent.com/284644/210108720-cb3ef5df-1745-4c19-8625-73f74a445c3d.png * Viz-> :doc:`Viewer Draw Curve ` -* Scene-> :doc:`Get Objects Data ` +* Scene-> :doc:`Get Objects Data ` Uniform (yellow) vs non-uniform (green) spline: @@ -134,7 +134,7 @@ Uniform (yellow) vs non-uniform (green) spline: * Viz-> :doc:`Viewer Draw ` * Viz-> :doc:`Viewer Draw Curve ` -* Scene-> :doc:`Get Objects Data ` +* Scene-> :doc:`Get Objects Data ` Non-uniform splines with Euclidean metric (yellow) and with centripetal metric (green): @@ -143,7 +143,7 @@ Non-uniform splines with Euclidean metric (yellow) and with centripetal metric ( * Viz-> :doc:`Viewer Draw ` * Viz-> :doc:`Viewer Draw Curve ` -* Scene-> :doc:`Get Objects Data ` +* Scene-> :doc:`Get Objects Data ` Non-uniform (Euclidean) Catmull-Rom spline (yellow) vs Cubic spline (blue): @@ -152,7 +152,7 @@ Non-uniform (Euclidean) Catmull-Rom spline (yellow) vs Cubic spline (blue): * Viz-> :doc:`Viewer Draw ` * Viz-> :doc:`Viewer Draw Curve ` -* Scene-> :doc:`Get Objects Data ` +* Scene-> :doc:`Get Objects Data ` Uniform splines with different tension values: from 0.2 (almost black lines) to 2.0 (white line): @@ -165,7 +165,7 @@ Uniform splines with different tension values: from 0.2 (almost black lines) to * List->List Struct-> :doc:`List Levels ` * Color-> :doc:`Color In ` * Viz-> :doc:`Viewer Draw ` -* Scene-> :doc:`Get Objects Data ` +* Scene-> :doc:`Get Objects Data ` Here the curvature comb is used to illustrate that the curvature of Catmull-Rom splines can change very fast and sudden: @@ -175,5 +175,5 @@ splines can change very fast and sudden: * Viz-> :doc:`Viewer Draw ` * Viz-> :doc:`Viewer Draw Curve ` -* Scene-> :doc:`Get Objects Data ` +* Scene-> :doc:`Get Objects Data ` diff --git a/docs/nodes/curve/kinky_curve.rst b/docs/nodes/curve/kinky_curve.rst index f85f249dcd..2f72052e83 100644 --- a/docs/nodes/curve/kinky_curve.rst +++ b/docs/nodes/curve/kinky_curve.rst @@ -101,7 +101,7 @@ A simple example: * Matrix-> :doc:`Matrix In ` * Viz-> :doc:`Viewer Draw Curve ` * Viz-> :doc:`Viewer Index+ ` -* Scene-> :doc:`Get Objects Data ` +* Scene-> :doc:`Get Objects Data ` --------- diff --git a/docs/nodes/curve/nurbs_curve.rst b/docs/nodes/curve/nurbs_curve.rst index 6b41f7aad7..b1e79d43b4 100644 --- a/docs/nodes/curve/nurbs_curve.rst +++ b/docs/nodes/curve/nurbs_curve.rst @@ -135,4 +135,4 @@ Updated example: * Number-> :doc:`List Input ` * Vector-> :doc:`Vector sort ` * Viz-> :doc:`Viewer Draw Curve ` -* Scene-> :doc:`Get Objects Data ` \ No newline at end of file +* Scene-> :doc:`Get Objects Data ` \ No newline at end of file diff --git a/docs/nodes/curve/offset_mk2.rst b/docs/nodes/curve/offset_mk2.rst index b145362c22..8a35298e96 100644 --- a/docs/nodes/curve/offset_mk2.rst +++ b/docs/nodes/curve/offset_mk2.rst @@ -235,7 +235,7 @@ Offset one curve with several different offset amounts: * Number-> :doc:`Number Range ` * Vector-> :doc:`Vector sort ` * Viz-> :doc:`Viewer Draw ` -* Scene-> :doc:`Get Objects Data ` +* Scene-> :doc:`Get Objects Data ` --------- @@ -249,7 +249,7 @@ Example of **Custom (N/B/T)** mode usage: * Number-> :doc:`Number Range ` * Vector-> :doc:`Vector sort ` * Vector-> :doc:`Vector Polar Input ` -* Scene-> :doc:`Get Objects Data ` +* Scene-> :doc:`Get Objects Data ` * Viz-> :doc:`Viewer Draw ` --------- @@ -272,7 +272,7 @@ the tangent of original curve is perpendicular to offset operation plane. * Number-> :doc:`A Number ` * Vector-> :doc:`Vector sort ` * List->List Struct-> :doc:`List Item ` -* Scene-> :doc:`Get Objects Data ` +* Scene-> :doc:`Get Objects Data ` * Text-> :doc:`Stethoscope ` * Viz-> :doc:`Viewer Draw ` @@ -293,7 +293,7 @@ Example of **Variable** offset mode usage: * Number-> :doc:`A Number ` * Vector-> :doc:`Vector sort ` * List->List Struct-> :doc:`List Item ` -* Scene-> :doc:`Get Objects Data ` +* Scene-> :doc:`Get Objects Data ` * Text-> :doc:`Stethoscope ` * Viz-> :doc:`Viewer Draw ` diff --git a/docs/nodes/curve/ortho_project.rst b/docs/nodes/curve/ortho_project.rst index 2970b46d87..1e08dbbf2b 100644 --- a/docs/nodes/curve/ortho_project.rst +++ b/docs/nodes/curve/ortho_project.rst @@ -92,4 +92,4 @@ Take points on a straight line and project them to some curve: * Transform-> :doc:`Matrix Apply (verts) ` * Viz-> :doc:`Viewer Draw ` * Scene-> :doc:`Bezier Input ` -* Scene-> :doc:`Get Objects Data ` \ No newline at end of file +* Scene-> :doc:`Get Objects Data ` \ No newline at end of file diff --git a/docs/nodes/field/mesh_surface_field.rst b/docs/nodes/field/mesh_surface_field.rst index fb6e94cb7d..498922eb06 100644 --- a/docs/nodes/field/mesh_surface_field.rst +++ b/docs/nodes/field/mesh_surface_field.rst @@ -41,7 +41,7 @@ With real mesh you can get very funny results: * Surfaces-> :doc:`Marching Cubes ` * Matrix-> :doc:`Matrix Apply to Mesh ` * Viz-> :doc:`Viewer Draw ` -* Scene-> :doc:`Get Objects Data ` +* Scene-> :doc:`Get Objects Data ` Inputs ------ diff --git a/docs/nodes/modifier_change/delete_loose.rst b/docs/nodes/modifier_change/delete_loose.rst index ec25862aed..89a8315a46 100644 --- a/docs/nodes/modifier_change/delete_loose.rst +++ b/docs/nodes/modifier_change/delete_loose.rst @@ -32,6 +32,6 @@ Simple: .. image:: https://user-images.githubusercontent.com/14288520/199108536-900db4f5-4347-48fe-8ccc-5dbb748c188b.png :target: https://user-images.githubusercontent.com/14288520/199108536-900db4f5-4347-48fe-8ccc-5dbb748c188b.png -* Scene-> :doc:`Get Objects Data ` +* Scene-> :doc:`Get Objects Data ` * Viz-> :doc:`Viewer Draw ` * Text-> :doc:`Stethoscope ` \ No newline at end of file diff --git a/docs/nodes/modifier_make/fractal_curve.rst b/docs/nodes/modifier_make/fractal_curve.rst index 69ca4dafa5..91f7b9c3dc 100644 --- a/docs/nodes/modifier_make/fractal_curve.rst +++ b/docs/nodes/modifier_make/fractal_curve.rst @@ -102,5 +102,5 @@ Vectorization example: * Number-> :doc:`List Input ` * Modifiers->Modifier Make-> :doc:`UV Connection ` * Vector-> :doc:`Vector sort ` -* Scene-> :doc:`Get Objects Data ` +* Scene-> :doc:`Get Objects Data ` * Viz-> :doc:`Viewer Draw ` \ No newline at end of file diff --git a/docs/nodes/modifier_make/offset_line.rst b/docs/nodes/modifier_make/offset_line.rst index 1c0967a05d..583f49dcb4 100644 --- a/docs/nodes/modifier_make/offset_line.rst +++ b/docs/nodes/modifier_make/offset_line.rst @@ -105,6 +105,6 @@ Using of Z coordinate: .. image:: https://user-images.githubusercontent.com/14288520/200909050-34199e42-54aa-41cf-9efb-abef230afdf7.png :target: https://user-images.githubusercontent.com/14288520/200909050-34199e42-54aa-41cf-9efb-abef230afdf7.png -* Scene-> :doc:`Get Objects Data ` +* Scene-> :doc:`Get Objects Data ` * Matrix-> :doc:`Matrix In ` * Viz-> :doc:`Viewer Draw ` \ No newline at end of file diff --git a/docs/nodes/scene/get_objects_data_mk2.rst b/docs/nodes/scene/get_objects_data.rst similarity index 100% rename from docs/nodes/scene/get_objects_data_mk2.rst rename to docs/nodes/scene/get_objects_data.rst diff --git a/docs/nodes/spatial/delaunay_2d_cdt.rst b/docs/nodes/spatial/delaunay_2d_cdt.rst index 05447be7f5..1c1efd66e9 100644 --- a/docs/nodes/spatial/delaunay_2d_cdt.rst +++ b/docs/nodes/spatial/delaunay_2d_cdt.rst @@ -84,7 +84,7 @@ Examples .. image:: https://user-images.githubusercontent.com/14288520/202170634-f26119f8-bf1c-41a6-881e-cf1d4fdf3739.png :target: https://user-images.githubusercontent.com/14288520/202170634-f26119f8-bf1c-41a6-881e-cf1d4fdf3739.png -* Scene-> :doc:`Get Objects Data ` +* Scene-> :doc:`Get Objects Data ` * Spatial-> :doc:`Populate Mesh ` * List->List Main-> :doc:`List Join ` * Viz-> :doc:`Viewer Draw ` diff --git a/docs/nodes/transforms/transform_mesh.rst b/docs/nodes/transforms/transform_mesh.rst index 861338694a..f642b71b3f 100644 --- a/docs/nodes/transforms/transform_mesh.rst +++ b/docs/nodes/transforms/transform_mesh.rst @@ -161,5 +161,5 @@ Examples * Generator-> :doc:`Suzanne ` * Matrix-> :doc:`Matrix Out ` -* Scene-> :doc:`Get Objects Data ` +* Scene-> :doc:`Get Objects Data ` * Analyzers-> :doc:`Select Mesh Elements ` \ No newline at end of file diff --git a/docs/nodes/viz/viewer_nurbs_curve.rst b/docs/nodes/viz/viewer_nurbs_curve.rst index 96514d312c..c876256a20 100644 --- a/docs/nodes/viz/viewer_nurbs_curve.rst +++ b/docs/nodes/viz/viewer_nurbs_curve.rst @@ -61,4 +61,4 @@ Examples of usage .. image:: https://user-images.githubusercontent.com/14288520/190427453-6d1dcb65-e0ce-4194-9860-d1faf4df478b.png :target: https://user-images.githubusercontent.com/14288520/190427453-6d1dcb65-e0ce-4194-9860-d1faf4df478b.png -* Scene-> :doc:`Get Objects Data ` \ No newline at end of file +* Scene-> :doc:`Get Objects Data ` \ No newline at end of file From bb19f44235970635d20e0ac5716cc2283b2b5a47 Mon Sep 17 00:00:00 2001 From: satabol Date: Wed, 18 Oct 2023 17:24:48 +0300 Subject: [PATCH 10/10] fix #5019 Extend node "Get object data" with options "apply matrix" and "join mesh" (merge). fix out data from Vectors to lists --- nodes/scene/get_objects_data.py | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/nodes/scene/get_objects_data.py b/nodes/scene/get_objects_data.py index 2d6c9a7871..947b29eb78 100644 --- a/nodes/scene/get_objects_data.py +++ b/nodes/scene/get_objects_data.py @@ -347,9 +347,11 @@ def process(self): obj_data = obj.to_mesh(preserve_all_data_layers=True, depsgraph=sv_depsgraph) else: obj_data = obj.to_mesh() + + T, R, S = mtrx.decompose() if o_vs: - verts = [ Vector(v.co) for v in obj_data.vertices] # v.co is a Vector() + verts = [ ((mtrx @ v.co) if self.apply_matrix else v.co)[:] for v in obj_data.vertices] # v.co is a Vector() if o_es: edgs = [[ e.vertices[0], e.vertices[1] ] for e in obj_data.edges] if o_ps: @@ -357,28 +359,17 @@ def process(self): if self.vergroups: vert_groups = get_vertgroups(obj_data) if o_vn: - vertex_normals = [ Vector(v.normal) for v in obj_data.vertices ] # v.normal is a Vector(). Update. Blender 3.6.3 crash in no wrap Vector(v.normal). I think this is after line "obj.to_mesh_clear()" + vertex_normals = [ (( R @ v.co) if self.apply_matrix else v.normal)[:] for v in obj_data.vertices ] # v.normal is a Vector(). Update. Blender 3.6.3 crash in no wrap Vector(v.normal). I think this is after line "obj.to_mesh_clear()" if o_mi: material_indexes = read_materials_idx(obj_data, out_np[3]) if o_pa: polygons_areas = [ polygon.area for polygon in obj_data.polygons] if o_pc: - polygon_centers = [ Vector(polygon.center) for polygon in obj_data.polygons] + polygon_centers = [ ((mtrx @ polygon.center) if self.apply_matrix else polygon.center)[:] for polygon in obj_data.polygons] if o_pn: - polygon_normals = [ Vector(polygon.normal) for polygon in obj_data.polygons ] + polygon_normals = [ (( R @ polygon.normal) if self.apply_matrix else polygon.normal)[:] for polygon in obj_data.polygons] obj.to_mesh_clear() - - if self.apply_matrix: - if o_vs: - verts = [ tuple(mtrx @ v ) for v in verts ] - T, R, S = mtrx.decompose() - if o_vn: - vertex_normals = [ tuple( R @ vertex_normal ) for vertex_normal in vertex_normals ] - if o_pc: - polygon_centers = [ tuple( mtrx @ polygon_center) for polygon_center in polygon_centers ] - if o_pn: - polygon_normals = [ tuple( R @ polygon_normal) for polygon_normal in polygon_normals ] if o_vs: vs.append( verts ) @@ -420,12 +411,12 @@ def process(self): _es.extend( [[i + offset for i in o] for o in es[idx] ] ) # edges if ps: _ps.extend( [[i + offset for i in o] for o in ps[idx] ] ) # polygons - #_vn.extend( [tuple(i + offset for i in o) for o in ps[idx] ] ) # vers_out_grouped + #_vn.extend( [tuple(i + offset for i in o) for o in ps[idx] ] ) # vers_out_grouped. Skip in mesh_join if vn: _vn.extend( vn[idx] ) # vertex normals # _mi - materia index. Do not change # if mi and len(mi)>idx: - # _mi.extend( mi[idx] ) + # _mi.extend( mi[idx] ) # Skip in mesh_join if pa: _pa.extend( pa[idx] ) # polygon area if pc: @@ -433,7 +424,7 @@ def process(self): if pn: _pn.extend( pn[idx] ) # polygon normal # if ms: Do not change - # _ms.append( ms[idx] ) # matrices + # _ms.append( ms[idx] ) # matrices. Skip in mesh_join if vers_out_grouped: _vg.extend( [ i + offset for i in vers_out_grouped[idx] ] ) # vertex groups