From noreply at git.blender.org Wed Dec 1 00:51:13 2021 From: noreply at git.blender.org (Campbell Barton) Date: Wed, 1 Dec 2021 00:51:13 +0100 (CET) Subject: [Bf-extensions-cvs] [1d91e8c1] master: Cleanup: trailing space & tabs to spaces In-Reply-To: <163831627374.3561.3397537285806655811@git.blender.org> References: <163831627374.3561.3397537285806655811@git.blender.org> Message-ID: <20211130235114.054B3295A5@git.blender.org> Commit: 1d91e8c12a25618c308fcd25108bf36af0f27094 Author: Campbell Barton Date: Wed Dec 1 09:58:31 2021 +1100 Branches: master https://developer.blender.org/rBA1d91e8c12a25618c308fcd25108bf36af0f27094 Cleanup: trailing space & tabs to spaces =================================================================== M add_mesh_extra_objects/add_mesh_gears.py M greasepencil_tools/box_deform.py M greasepencil_tools/prefs.py M greasepencil_tools/timeline_scrub.py M io_anim_bvh/import_bvh.py M io_export_dxf/export_dxf.py M io_import_dxf/dxfgrabber/dxfentities.py M io_scene_x3d/import_x3d.py M mesh_looptools.py M mesh_tools/mesh_relax.py M pose_library/gui.py M precision_drawing_tools/pdt_command.py M precision_drawing_tools/pdt_command_functions.py M precision_drawing_tools/pdt_design.py M precision_drawing_tools/pdt_exception.py M precision_drawing_tools/pdt_functions.py M precision_drawing_tools/pdt_library.py M precision_drawing_tools/pdt_menus.py M precision_drawing_tools/pdt_msg_strings.py M precision_drawing_tools/pdt_pivot_point.py M precision_drawing_tools/pdt_tangent.py M precision_drawing_tools/pdt_trig_waves.py M precision_drawing_tools/pdt_view.py M presets/pov/light/24_(1850K)_Candle.py M real_snow.py M rigify/utils/mechanism.py M system_blend_info.py M viewport_vr_preview/action_map.py M viewport_vr_preview/action_map_io.py M viewport_vr_preview/configs/default.py M viewport_vr_preview/defaults.py M viewport_vr_preview/operators.py M viewport_vr_preview/versioning.py =================================================================== diff --git a/add_mesh_extra_objects/add_mesh_gears.py b/add_mesh_extra_objects/add_mesh_gears.py index 1d3bc70e..4d9f0168 100644 --- a/add_mesh_extra_objects/add_mesh_gears.py +++ b/add_mesh_extra_objects/add_mesh_gears.py @@ -93,13 +93,13 @@ def createFaces(vertIdx1, vertIdx2, closed=False, flipped=False): # Calculate the vertex coordinates for a single # section of a gear tooth. # Returns 4 lists of vertex coords (list of tuples): -# *-*---*---* (1.) verts_inner_base +# *-*---*---* (1.) verts_inner_base # | | | | -# *-*---*---* (2.) verts_outer_base +# *-*---*---* (2.) verts_outer_base # | | | -# *---*---* (3.) verts_middle_tooth +# *---*---* (3.) verts_middle_tooth # \ | / -# *-*-* (4.) verts_tip_tooth +# *-*-* (4.) verts_tip_tooth # # a # t diff --git a/greasepencil_tools/box_deform.py b/greasepencil_tools/box_deform.py index 607d8a7d..4c2de720 100644 --- a/greasepencil_tools/box_deform.py +++ b/greasepencil_tools/box_deform.py @@ -333,7 +333,7 @@ def cancel_cage(self): self.gp_obj.grease_pencil_modifiers.remove(mod) else: print(f'tmp_lattice modifier not found to remove on {self.gp_obj.name}') - + for ob in self.other_gp: mod = ob.grease_pencil_modifiers.get('tmp_lattice') if mod: @@ -586,7 +586,7 @@ valid:Spacebar/Enter, cancel:Del/Backspace/Tab/Ctrl+T" ## silent return return {'CANCELLED'} - + # bpy.ops.ed.undo_push(message="Box deform step")#don't work as expected (+ might be obsolete) # https://developer.blender.org/D6147 <- undo forget diff --git a/greasepencil_tools/prefs.py b/greasepencil_tools/prefs.py index 929197d5..11d3d0be 100644 --- a/greasepencil_tools/prefs.py +++ b/greasepencil_tools/prefs.py @@ -89,7 +89,7 @@ class GreasePencilAddonPrefs(bpy.types.AddonPreferences): name = "Use Hud", description = "Display angle lines and angle value as text on viewport", default = False) - + canvas_use_view_center: BoolProperty( name = "Rotate From View Center In Camera", description = "Rotate from view center in camera view, Else rotate from camera center", diff --git a/greasepencil_tools/timeline_scrub.py b/greasepencil_tools/timeline_scrub.py index 9946975e..f6ba9eaa 100644 --- a/greasepencil_tools/timeline_scrub.py +++ b/greasepencil_tools/timeline_scrub.py @@ -211,7 +211,7 @@ class GPTS_OT_time_scrub(bpy.types.Operator): else: self.init_index = 0 self.init_frame = self.new_frame = self.pos[0] - + # del active_pos self.index_limit = len(self.pos) - 1 @@ -311,14 +311,14 @@ class GPTS_OT_time_scrub(bpy.types.Operator): shader = gpu.shader.from_builtin('2D_UNIFORM_COLOR') # initiate shader self.batch_timeline = batch_for_shader( shader, 'LINES', {"pos": self.hud_lines}) - + if self.rolling_mode: current_id = self.pos.index(self.new_frame) # Add init_frame to "cancel" it in later UI code ui_key_pos = [i - current_id + self.init_frame for i, _f in enumerate(self.pos[:-2])] else: ui_key_pos = self.pos[:-2] - + # keyframe display if self.keyframe_aspect == 'LINE': @@ -725,7 +725,7 @@ def draw_ts_pref(prefs, layout): snap_text = 'Disable keyframes snap: ' else: snap_text = 'Keyframes snap: ' - + snap_text += 'Left Mouse' if prefs.keycode == 'RIGHTMOUSE' else 'Right Mouse' if not prefs.use_ctrl: snap_text += ' or Ctrl' @@ -733,7 +733,7 @@ def draw_ts_pref(prefs, layout): snap_text += ' or Shift' if not prefs.use_alt: snap_text += ' or Alt' - + if prefs.rolling_mode: snap_text = 'Gap-less mode (always snap)' diff --git a/io_anim_bvh/import_bvh.py b/io_anim_bvh/import_bvh.py index e43b6090..4710a137 100644 --- a/io_anim_bvh/import_bvh.py +++ b/io_anim_bvh/import_bvh.py @@ -320,7 +320,7 @@ def read_bvh(context, file_path, rotate_mode='XYZ', global_scale=1.0): else: # allow this, see above # if not bvh_node.children: - # raise Exception("bvh node has no end and no children. bad file") + # raise Exception("bvh node has no end and no children. bad file") # Removed temp for now rest_tail_world = Vector((0.0, 0.0, 0.0)) diff --git a/io_export_dxf/export_dxf.py b/io_export_dxf/export_dxf.py index 71434a71..c4088c6d 100644 --- a/io_export_dxf/export_dxf.py +++ b/io_export_dxf/export_dxf.py @@ -64,10 +64,10 @@ def exportDXF(context, filePath, settings): if not drawing.isEmpty(): # NOTE: Only orthographic projection used now. - # if PERSPECTIVE: # generate view border - passepartout - # from .primitive_exporters.viewborder_exporter import ViewBorderDXFExporter - # e = ViewBorderDXFExporter(settings) - # e.export(drawing, ob, mx, mw) + # if PERSPECTIVE: # generate view border - passepartout + # from .primitive_exporters.viewborder_exporter import ViewBorderDXFExporter + # e = ViewBorderDXFExporter(settings) + # e.export(drawing, ob, mx, mw) drawing.convert(filePath) @@ -172,38 +172,38 @@ def getCommons(ob, settings): def getCameraMatrix(cam): raise NotImplementedError() -# camProps = cam.data -# mc0 = act_camera.matrix.copy() -# #print 'deb: camera.Matrix=\n', mc0 #------------------ -# camera = Camera.Get(act_camera.getData(name_only=True)) -# #print 'deb: camera=', dir(camera) #------------------ -# if camera.type=='persp': PERSPECTIVE = 1 -# elif camera.type=='ortho': PERSPECTIVE = 0 -# # mcp is matrix.camera.perspective -# clip_box, mcp = getClipBox(camera) -## if PERSPECTIVE: -## # get border -## # lens = camera.lens -## min_X1, max_X1, min_Y1, max_Y1,\ -## min_X2, max_X2, min_Y2, max_Y2,\ -## min_Z, max_Z = clip_box -## verts = [] -## verts.append([min_X1, min_Y1, min_Z]) -## verts.append([max_X1, min_Y1, min_Z]) -## verts.append([max_X1, max_Y1, min_Z]) -## verts.append([min_X1, max_Y1, min_Z]) -## border=verts -# mw = mc0.copy().invert() -# #ViewVector = mathutils.Vector(Window.GetViewVector()) -# #print 'deb: ViewVector=\n', ViewVector #------------------ -# #TODO: what is Window.GetViewOffset() for? -# #print 'deb: Window.GetViewOffset():', Window.GetViewOffset() #--------- -# #Window.SetViewOffset([0,0,0]) -# mw0 = Window.GetViewMatrix() -# #print 'deb: mwOrtho =\n', mw0 #--------- -# mwp = Window.GetPerspMatrix() #TODO: how to get it working? -# #print 'deb: mwPersp =\n', mwp #--------- -# mw = mw0.copy() +# camProps = cam.data +# mc0 = act_camera.matrix.copy() +# #print 'deb: camera.Matrix=\n', mc0 #------------------ +# camera = Camera.Get(act_camera.getData(name_only=True)) +# #print 'deb: camera=', dir(camera) #------------------ +# if camera.type=='persp': PERSPECTIVE = 1 +# elif camera.type=='ortho': PERSPECTIVE = 0 +# # mcp is matrix.camera.perspective +# clip_box, mcp = getClipBox(camera) +## if PERSPECTIVE: +## # get border +## # lens = camera.lens +## min_X1, max_X1, min_Y1, max_Y1,\ +## min_X2, max_X2, min_Y2, max_Y2,\ +## min_Z, max_Z = clip_box +## verts = [] +## verts.append([min_X1, min_Y1, min_Z]) +## verts.append([max_X1, min_Y1, min_Z]) +## verts.append([max_X1, max_Y1, min_Z]) +## verts.append([min_X1, max_Y1, min_Z]) +## border=verts +# mw = mc0.copy().invert() +# #ViewVector = mathutils.Vector(Window.GetViewVector()) +# #print 'deb: ViewVector=\n', ViewVector #------------------ +# #TODO: what is Window.GetViewOffset() for? +# #print 'deb: Window.GetViewOffset():', Window.GetViewOffset() #--------- +# #Window.SetViewOffset([0,0,0]) +# mw0 = Window.GetViewMatrix() +# #print 'deb: mwOrtho =\n', mw0 #--------- +# mwp = Window.GetPerspMatrix() #TODO: how to get it working? +# #print 'deb: mwPersp =\n', mwp #--------- +# mw = mw0.copy() projectionMapping = { 'TOP' : mathutils.Vector((0, 0, -1)), @@ -241,10 +241,10 @@ def _exportItem(ctx, o, mw, drawing, settings): """ if settings['verbose']: print('Exporting %s' % o) #mx = ob.matrix.copy() - #print 'deb: ob =', ob #--------- - #print 'deb: ob.type =', ob.type #--------- - #print 'deb: mx =\n', mx #--------- - #print 'deb: mw0 =\n', mw0 #--------- + #print 'deb: ob =', ob #--------- + #print 'deb: ob.type =', ob.type #--------- + #print 'deb: mx =\n', mx #--------- + #print 'deb: mw0 =\n', mw0 #--------- #mx_n is trans-matrix for normal_vectors for front-side faces mx = o.matrix_world viewRotation = mw.to_euler().to_matrix() diff --git a/io_import_dxf/dxfgrabber/dxfentities.py b/io_import_dxf/dxfgrabber/dxfentities.py index 61ff351c..ea2eb9d0 100644 --- a/io_import_dxf/dxfgrabber/dxfentities.py +++ b/io_import_dxf/dxfgrabber/dxfentities.py @@ -739,24 +739,24 @@ def normalized(vector): ################################################## # MTEXT inline codes -# \L Start underline -# \l Stop underline -# \O Start overstrike -# \o Stop overstrike -# \K Start strike-through -# \k Stop strike-through -# \P New paragraph (new line) -# \pxi Control codes for bullets, numbered paragraphs and columns -# \X Paragraph wrap on the dimension line (only in dimensions) -# \Q Slanting (obliquing) text by angle - e.g. \Q30; -# \H Text height - e.g. \H3x; -# \W Text width - e.g. \W0.8x; -# \F Font selection +# \L Start underline +# \l Stop underline +# \O Start overstrike +# \o Stop overstrike +# \K Start strike-through +# \k @@ Diff output truncated at 10240 characters. @@ From noreply at git.blender.org Wed Dec 1 01:06:24 2021 From: noreply at git.blender.org (Campbell Barton) Date: Wed, 1 Dec 2021 01:06:24 +0100 (CET) Subject: [Bf-extensions-cvs] [a444e8cc] master: Cleanup: quiet character escape warnings In-Reply-To: <163831718474.35082.6600276049574119294@git.blender.org> References: <163831718474.35082.6600276049574119294@git.blender.org> Message-ID: <20211201000625.03D83299D2@git.blender.org> Commit: a444e8cc19a4353ce35ecdec9bb7894ee73a204a Author: Campbell Barton Date: Wed Dec 1 11:05:16 2021 +1100 Branches: master https://developer.blender.org/rBAa444e8cc19a4353ce35ecdec9bb7894ee73a204a Cleanup: quiet character escape warnings =================================================================== M development_iskeyfree.py M io_export_paper_model.py M io_import_dxf/dxfimport/do.py M lighting_dynamic_sky.py M mesh_inset/offset.py M node_wrangler.py M rigify/generate.py M rigify/rigs/faces/super_face.py M rigify/rigs/limbs/super_palm.py M sun_position/geo.py =================================================================== diff --git a/development_iskeyfree.py b/development_iskeyfree.py index e8215497..c2c338f4 100644 --- a/development_iskeyfree.py +++ b/development_iskeyfree.py @@ -509,7 +509,7 @@ class IsKeyFreeRunExportKeys(Operator): if new_name in list_txt: from re import findall - test_num = [findall("\d+", words) for words in list_txt] + test_num = [findall(r"\d+", words) for words in list_txt] suffix += max([int(l[-1]) for l in test_num]) new_name = "{}_{}{}".format(def_name, suffix, ext) return new_name diff --git a/io_export_paper_model.py b/io_export_paper_model.py index 8ea8cf9f..f92d940f 100644 --- a/io_export_paper_model.py +++ b/io_export_paper_model.py @@ -61,7 +61,7 @@ def first_letters(text): """Iterator over the first letter of each word""" for match in first_letters.pattern.finditer(text): yield text[match.start()] -first_letters.pattern = re_compile("((? \g<2>",fname) + fname = re.sub(r"([a-z])([A-Z])", r"\g<1> \g<2>",fname) # Replace common separators with SPACE seperators = ['_', '.', '-', '__', '--', '#'] for sep in seperators: diff --git a/rigify/generate.py b/rigify/generate.py index a2d9a5d1..501c335f 100644 --- a/rigify/generate.py +++ b/rigify/generate.py @@ -258,7 +258,7 @@ class Generator(base_generate.BaseGenerator): for tar in var.targets: # If a custom property if var.type == 'SINGLE_PROP' \ - and re.match('^pose.bones\["[^"\]]*"\]\["[^"\]]*"\]$', tar.data_path): + and re.match(r'^pose.bones\["[^"\]]*"\]\["[^"\]]*"\]$', tar.data_path): tar.data_path = "RIGIFY-" + tar.data_path diff --git a/rigify/rigs/faces/super_face.py b/rigify/rigs/faces/super_face.py index 312ecf56..32d013a7 100644 --- a/rigify/rigs/faces/super_face.py +++ b/rigify/rigs/faces/super_face.py @@ -71,8 +71,8 @@ class Rig: # RE pattern match right or left parts # match the letter "L" (or "R"), followed by an optional dot (".") # and 0 or more digits at the end of the the string - left_pattern = 'L\.?\d*$' - right_pattern = 'R\.?\d*$' + left_pattern = r'L\.?\d*$' + right_pattern = r'R\.?\d*$' left = sorted( [ name for name in bones if re.search( left_pattern, name ) ] ) right = sorted( [ name for name in bones if re.search( right_pattern, name ) ] ) diff --git a/rigify/rigs/limbs/super_palm.py b/rigify/rigs/limbs/super_palm.py index 47d5eaf3..7573e4a7 100644 --- a/rigify/rigs/limbs/super_palm.py +++ b/rigify/rigs/limbs/super_palm.py @@ -77,7 +77,7 @@ class Rig(BaseRig): self.order = 'YXZ' if 'X' in self.palm_rotation_axis else 'YZX' # Figure out the name for the control bone (remove the last .##) - self.ctrl_name = re.sub("([0-9]+\.)", "", strip_org(self.bones.org[-1])[::-1], count=1)[::-1] + self.ctrl_name = re.sub(r"([0-9]+\.)", "", strip_org(self.bones.org[-1])[::-1], count=1)[::-1] def parent_bones(self): self.rig_parent_bone = self.get_bone_parent(self.bones.org[0]) diff --git a/sun_position/geo.py b/sun_position/geo.py index 59c27e39..72404195 100644 --- a/sun_position/geo.py +++ b/sun_position/geo.py @@ -51,7 +51,7 @@ class Parser: # build pattern with subgroups sub_dict = {} subpattern_names = [] - for s in re.finditer("%\(.*?\)s", self.raw_patterns[pattern_name]): + for s in re.finditer(r"%\(.*?\)s", self.raw_patterns[pattern_name]): subpattern_name = s.group()[2:-2] if not self.virtual[subpattern_name]: sub_dict[subpattern_name] = "(" + self.patterns[ @@ -108,7 +108,7 @@ position_parser.add("minutes", r"%(number)s\s*%(minutes_symbol)s") position_parser.add("seconds", r"%(number)s\s*%(seconds_symbol)s") position_parser.add( "degree_coordinates", - "(?:%(sign)s\s*)?%(degrees)s(?:[+\s]*%(minutes)s)?(?:[+\s]*%(seconds)s)?|(?:%(sign)s\s*)%(minutes)s(?:[+\s]*%(seconds)s)?|(?:%(sign)s\s*)%(seconds)s" + r"(?:%(sign)s\s*)?%(degrees)s(?:[+\s]*%(minutes)s)?(?:[+\s]*%(seconds)s)?|(?:%(sign)s\s*)%(minutes)s(?:[+\s]*%(seconds)s)?|(?:%(sign)s\s*)%(seconds)s" ) position_parser.add( @@ -119,13 +119,13 @@ position_parser.add( r"%(nmea_style)s|%(plain_degrees)s|%(degree_coordinates)s") position_parser.add( - "position", """\ -\s*%(direction_ns)s\s*%(coordinates_ns)s[,;\s]*%(direction_ew)s\s*%(coordinates_ew)s\s*|\ -\s*%(direction_ew)s\s*%(coordinates_ew)s[,;\s]*%(direction_ns)s\s*%(coordinates_ns)s\s*|\ -\s*%(coordinates_ns)s\s*%(direction_ns)s[,;\s]*%(coordinates_ew)s\s*%(direction_ew)s\s*|\ -\s*%(coordinates_ew)s\s*%(direction_ew)s[,;\s]*%(coordinates_ns)s\s*%(direction_ns)s\s*|\ -\s*%(coordinates_ns)s[,;\s]+%(coordinates_ew)s\s*\ -""") + "position", ( + r"\s*%(direction_ns)s\s*%(coordinates_ns)s[,;\s]*%(direction_ew)s\s*%(coordinates_ew)s\s*|" + r"\s*%(direction_ew)s\s*%(coordinates_ew)s[,;\s]*%(direction_ns)s\s*%(coordinates_ns)s\s*|" + r"\s*%(coordinates_ns)s\s*%(direction_ns)s[,;\s]*%(coordinates_ew)s\s*%(direction_ew)s\s*|" + r"\s*%(coordinates_ew)s\s*%(direction_ew)s[,;\s]*%(coordinates_ns)s\s*%(direction_ns)s\s*|" + r"\s*%(coordinates_ns)s[,;\s]+%(coordinates_ew)s\s*" + )) def get_number(b): From noreply at git.blender.org Tue Dec 7 12:55:07 2021 From: noreply at git.blender.org (Peter Kim) Date: Tue, 7 Dec 2021 12:55:07 +0100 (CET) Subject: [Bf-extensions-cvs] [c60fef38] master: Fix T93509: Unintended navigation on Valve Index In-Reply-To: <163887810773.79341.10003241756470280700@git.blender.org> References: <163887810773.79341.10003241756470280700@git.blender.org> Message-ID: <20211207115507.F414A4B97@git.blender.org> Commit: c60fef38175ad989ee0c45e924cb27e1417c8667 Author: Peter Kim Date: Tue Dec 7 20:54:20 2021 +0900 Branches: master https://developer.blender.org/rBAc60fef38175ad989ee0c45e924cb27e1417c8667 Fix T93509: Unintended navigation on Valve Index The input bindings for "grab" navigation on the Valve Index controllers could previously trigger the action even when the user did not intend to do so (i.e. their hand was not actively gripping the sensor). This was resolved by changing the bindings from "/input/squeeze/value" to "/input/squeeze/force" and increasing the input threshold from 0.3 to 0.5. Thanks to sybren for testing. =================================================================== M viewport_vr_preview/configs/default.py M viewport_vr_preview/defaults.py =================================================================== diff --git a/viewport_vr_preview/configs/default.py b/viewport_vr_preview/configs/default.py index bf4c46c7..a20c5c6d 100644 --- a/viewport_vr_preview/configs/default.py +++ b/viewport_vr_preview/configs/default.py @@ -54,7 +54,7 @@ actionconfig_data = \ {"bindings": [("cosmos", {"profile": '/interaction_profiles/htc/vive_cosmos_controller', "component_path0": '/input/squeeze/click', "component_path1": '/input/squeeze/click', "threshold": '0.30000001192092896', "axis_region": 'ANY'}), ("huawei", {"profile": '/interaction_profiles/huawei/controller', "component_path0": '/input/trackpad/click', "component_path1": '/input/trackpad/click', "threshold": '0.30000001192092896', "axis_region": 'ANY'}), - ("index", {"profile": '/interaction_profiles/valve/index_controller', "component_path0": '/input/squeeze/value', "component_path1": '/input/squeeze/value', "threshold": '0.30000001192092896', "axis_region": 'ANY'}), + ("index", {"profile": '/interaction_profiles/valve/index_controller', "component_path0": '/input/squeeze/force', "component_path1": '/input/squeeze/force', "threshold": '0.5', "axis_region": 'ANY'}), ("oculus", {"profile": '/interaction_profiles/oculus/touch_controller', "component_path0": '/input/squeeze/value', "component_path1": '/input/squeeze/value', "threshold": '0.30000001192092896', "axis_region": 'ANY'}), ("reverb_g2", {"profile": '/interaction_profiles/hp/mixed_reality_controller', "component_path0": '/input/squeeze/value', "component_path1": '/input/squeeze/value', "threshold": '0.30000001192092896', "axis_region": 'ANY'}), ("simple", {"profile": '/interaction_profiles/khr/simple_controller', "component_path0": '/input/menu/click', "component_path1": '/input/menu/click', "threshold": '0.30000001192092896', "axis_region": 'ANY'}), diff --git a/viewport_vr_preview/defaults.py b/viewport_vr_preview/defaults.py index fc768b8a..2543cd03 100644 --- a/viewport_vr_preview/defaults.py +++ b/viewport_vr_preview/defaults.py @@ -453,9 +453,9 @@ def vr_defaults_create_default(session_state): vr_defaults_actionbinding_add(ami, VRDefaultActionbindings.INDEX.value, VRDefaultActionprofiles.INDEX.value, - "/input/squeeze/value", - "/input/squeeze/value", - 0.3, + "/input/squeeze/force", + "/input/squeeze/force", + 0.5, 'ANY', 'ANY') vr_defaults_actionbinding_add(ami, From noreply at git.blender.org Tue Dec 7 15:54:34 2021 From: noreply at git.blender.org (Thomas Dinges) Date: Tue, 7 Dec 2021 15:54:34 +0100 (CET) Subject: [Bf-extensions-cvs] [69c817b8] blender-v2.93-release: Magic UV: Remove online updater In-Reply-To: <163888887439.60850.10644625228851470746@git.blender.org> References: <163888887439.60850.10644625228851470746@git.blender.org> Message-ID: <20211207145434.AAFE17107@git.blender.org> Commit: 69c817b87a25022e7413a635c60270a2516d4403 Author: Thomas Dinges Date: Wed Nov 24 14:29:16 2021 +0100 Branches: blender-v2.93-release https://developer.blender.org/rBA69c817b87a25022e7413a635c60270a2516d4403 Magic UV: Remove online updater Add-ons should not connect to external services outside of blender.org See new key requirements: https://wiki.blender.org/wiki/Process/Addons =================================================================== M magic_uv/__init__.py M magic_uv/preferences.py D magic_uv/updater.py M magic_uv/utils/__init__.py D magic_uv/utils/addon_updater.py =================================================================== diff --git a/magic_uv/__init__.py b/magic_uv/__init__.py index d0b8ae45..f31ad26b 100644 --- a/magic_uv/__init__.py +++ b/magic_uv/__init__.py @@ -52,7 +52,6 @@ if "bpy" in locals(): importlib.reload(ui) importlib.reload(properites) importlib.reload(preferences) - importlib.reload(updater) else: import bpy from . import common @@ -61,14 +60,11 @@ else: from . import ui from . import properites from . import preferences - from . import updater import bpy def register(): - updater.register_updater(bl_info) - utils.bl_class_registry.BlClassRegistry.register() properites.init_props(bpy.types.Scene) user_prefs = utils.compatibility.get_user_preferences(bpy.context) diff --git a/magic_uv/preferences.py b/magic_uv/preferences.py index 21f70508..7d6ac957 100644 --- a/magic_uv/preferences.py +++ b/magic_uv/preferences.py @@ -59,9 +59,7 @@ from .ui.IMAGE_MT_uvs import ( MUV_MT_UVInspection, ) from .utils.bl_class_registry import BlClassRegistry -from .utils.addon_updater import AddonUpdaterManager from .utils import compatibility as compat -from . import updater def view3d_uvmap_menu_fn(self, context): @@ -169,14 +167,6 @@ def remove_builtin_menu(): bpy.types.VIEW3D_MT_uv_map.remove(view3d_uvmap_menu_fn) -def get_update_candidate_branches(_, __): - manager = AddonUpdaterManager.get_instance() - if not manager.candidate_checked(): - return [] - - return [(name, name, "") for name in manager.get_candidate_branch_names()] - - def set_debug_mode(self, value): self['enable_debug_mode'] = value @@ -301,7 +291,6 @@ class MUV_Preferences(AddonPreferences): items=[ ('INFO', "Information", "Information about this add-on"), ('CONFIG', "Configuration", "Configuration about this add-on"), - ('UPDATE', "Update", "Update this add-on"), ], default='INFO' ) @@ -336,13 +325,6 @@ class MUV_Preferences(AddonPreferences): default=False ) - # for add-on updater - updater_branch_to_update = EnumProperty( - name="branch", - description="Target branch to update add-on", - items=get_update_candidate_branches - ) - def draw(self, _): layout = self.layout @@ -520,6 +502,3 @@ class MUV_Preferences(AddonPreferences): col.prop(self, "uv_bounding_box_cp_size") col.prop(self, "uv_bounding_box_cp_react_size") layout.separator() - - elif self.category == 'UPDATE': - updater.draw_updater_ui(self) diff --git a/magic_uv/updater.py b/magic_uv/updater.py deleted file mode 100644 index 72d85766..00000000 --- a/magic_uv/updater.py +++ /dev/null @@ -1,144 +0,0 @@ -# - -# ##### 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 ##### - -__author__ = "Nutti " -__status__ = "production" -__version__ = "6.5" -__date__ = "6 Mar 2021" - -import os - -import bpy -from bpy.props import ( - StringProperty, -) - -from .utils.bl_class_registry import BlClassRegistry -from .utils.addon_updater import ( - AddonUpdaterManager, - AddonUpdaterConfig, - get_separator, -) -from .utils import compatibility as compat - - - at BlClassRegistry() -class MUV_OT_CheckAddonUpdate(bpy.types.Operator): - bl_idname = "uv.muv_check_addon_update" - bl_label = "Check Update" - bl_description = "Check Add-on Update" - bl_options = {'REGISTER', 'UNDO'} - - def execute(self, _): - updater = AddonUpdaterManager.get_instance() - updater.check_update_candidate() - - return {'FINISHED'} - - - at BlClassRegistry() - at compat.make_annotations -class MUV_OT_UpdateAddon(bpy.types.Operator): - bl_idname = "uv.muv_update_addon" - bl_label = "Update" - bl_description = "Update Add-on" - bl_options = {'REGISTER', 'UNDO'} - - branch_name = StringProperty( - name="Branch Name", - description="Branch name to update", - default="", - ) - - def execute(self, _): - updater = AddonUpdaterManager.get_instance() - updater.update(self.branch_name) - - return {'FINISHED'} - - -def draw_updater_ui(prefs_obj): - layout = prefs_obj.layout - updater = AddonUpdaterManager.get_instance() - - layout.separator() - - if not updater.candidate_checked(): - col = layout.column() - col.scale_y = 2 - row = col.row() - row.operator(MUV_OT_CheckAddonUpdate.bl_idname, - text="Check 'Magic UV' add-on update", - icon='FILE_REFRESH') - else: - row = layout.row(align=True) - row.scale_y = 2 - col = row.column() - col.operator(MUV_OT_CheckAddonUpdate.bl_idname, - text="Check 'Magic UV' add-on update", - icon='FILE_REFRESH') - col = row.column() - if updater.latest_version() != "": - col.enabled = True - ops = col.operator( - MUV_OT_UpdateAddon.bl_idname, - text="Update to the latest release version (version: {})" - .format(updater.latest_version()), - icon='TRIA_DOWN_BAR') - ops.branch_name = updater.latest_version() - else: - col.enabled = False - col.operator(MUV_OT_UpdateAddon.bl_idname, - text="No updates are available.") - - layout.separator() - layout.label(text="Manual Update:") - row = layout.row(align=True) - row.prop(prefs_obj, "updater_branch_to_update", text="Target") - ops = row.operator( - MUV_OT_UpdateAddon.bl_idname, text="Update", - icon='TRIA_DOWN_BAR') - ops.branch_name = prefs_obj.updater_branch_to_update - - layout.separator() - if updater.has_error(): - box = layout.box() - box.label(text=updater.error(), icon='CANCEL') - elif updater.has_info(): - box = layout.box() - box.label(text=updater.info(), icon='ERROR') - - -def register_updater(bl_info): - config = AddonUpdaterConfig() - config.owner = "nutti" - config.repository = "Magic-UV" - config.current_addon_path = os.path.dirname(os.path.realpath(__file__)) - config.branches = ["master"] - config.addon_directory = \ - config.current_addon_path[ - :config.current_addon_path.rfind(get_separator())] - config.min_release_version = bl_info["version"] - config.default_target_addon_path = "magic_uv" - config.target_addon_path = { - "master": "src{}magic_uv".format(get_separator()), - } - updater = AddonUpdaterManager.get_instance() - updater.init(bl_info, config) diff --git a/magic_uv/utils/__init__.py b/magic_uv/utils/__init__.py index 776c7564..87c6eacb 100644 --- a/magic_uv/utils/__init__.py +++ b/magic_uv/utils/__init__.py @@ -25,12 +25,10 @@ __date__ = "6 Mar 2021" if "bpy" in locals(): import importlib - importlib.reload(addon_updater) importlib.reload(bl_class_registry) importlib.reload(compatibility) importlib.reload(property_class_registry) else: - from . import addon_updater from . import bl_class_registry from . import compatibility from . import property_class_registry diff --git a/magic_uv/utils/addon_updater.py b/magic_uv/utils/addon_updater.py deleted file mode 100644 index 8c1601b8..00000000 --- a/magic_uv/utils/addon_updater.py +++ /dev/null @@ -1,372 +0,0 @@ -# - -# ##### 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 ##### - -__author__ = "Nutti " -__status__ = "production" -__version__ = "6.5" -__date__ = "6 Mar 2021" - -from threading import Lock -import urllib -import urllib.request -import ssl -import json -import os -import zipfile -import shutil -import datetime - - -def get_separator(): - if os.name == "nt": - return "\\" - return "/" - - -def _request(url, json_decode=True): - # pylint: disable=W0212 - ssl._create_default_https_context = ssl._create_unverified_context - req = urllib.request.Request(url) - - try: - result = urllib.request.urlopen(req) - except urllib.error.HTTPError as e: - raise RuntimeError("HTTP error ({})".format(str(e.code))) - except urllib.error.URLError as e: - raise RuntimeError("URL error ({})".format(str(e.reason))) - - data = result.read() - result.close() - - if json_decode: - try: - return json.JSONDecoder().decode(data.decode()) - except Exception as e: - raise RuntimeError("API response has invalid JSON format ({})" - .format(s @@ Diff output truncated at 10240 characters. @@ From noreply at git.blender.org Tue Dec 14 12:45:05 2021 From: noreply at git.blender.org (Demeter Dzadik) Date: Tue, 14 Dec 2021 12:45:05 +0100 (CET) Subject: [Bf-extensions-cvs] [ece39d80] master: Rigify: Clean up "Rigify Buttons" panel UX In-Reply-To: <163948230565.35825.1638714750247640388@git.blender.org> References: <163948230565.35825.1638714750247640388@git.blender.org> Message-ID: <20211214114506.000001EF21@git.blender.org> Commit: ece39d809ceb27b5a06da7c4b8f25ca77016b151 Author: Demeter Dzadik Date: Tue Dec 14 12:44:52 2021 +0100 Branches: master https://developer.blender.org/rBAece39d809ceb27b5a06da7c4b8f25ca77016b151 Rigify: Clean up "Rigify Buttons" panel UX The overall goal of this patch is to improve the UI/UX of the panel previously known as "Rigify Buttons" which presumably takes its name from the old "Buttons Panel" which is now known as the Properties Editor. Before: {F10511640} After: {F10511624} - Make Rigify less reliant on name matching when it comes to maintaining the link between the metarig, the UI script, the generated rig, and the widgets collection. (Use pointers only, names shouldn't matter!) - Change the "Advanced" toggle button into a real sub-panel. - Split up the "Rigify Buttons" panels into "Rigify Generation" and "Rigify Samples" panels in non-edit and edit mode respectively, to better describe what the user will find there. Changes in the Rigify Buttons panel: - Removed the "overwrite/new" enum. - If there is a target rig object, it will be overwritten. If not, it will be created. - If a rig object with the desired name already existed, but wasn't selected as the target rig, the "overwrite" option still overwrote that rig. I don't agree with that because this meant messing with data without indicating that that data is going to be messed with. Unaware users could lose data/work. With these changes, the worst thing that can happen is that your rig ends up with a .001 suffix. - Removed the "rig name" text input field. Before this patch, this would always rename your rig object and your rig script text datablock, which I think is more frustrating than useful. Now you can simply rename them after generation yourself, and the names will be kept in subsequent generations. - Single-column layout - Changed the "Advanced Options" into a sub-panel instead. On request: - Added an info message to show the name of the successfully generated rig: {F10159079} Feedback welcome. Reviewed By: angavrilov Differential Revision: https://developer.blender.org/D11356 =================================================================== M rigify/__init__.py M rigify/generate.py M rigify/rig_ui_template.py M rigify/ui.py M rigify/utils/collections.py M rigify/utils/widgets.py =================================================================== diff --git a/rigify/__init__.py b/rigify/__init__.py index 019adb48..20e18a42 100644 --- a/rigify/__init__.py +++ b/rigify/__init__.py @@ -512,20 +512,6 @@ def register(): IDStore.rigify_types = CollectionProperty(type=RigifyName) IDStore.rigify_active_type = IntProperty(name="Rigify Active Type", description="The selected rig type") - bpy.types.Armature.rigify_advanced_generation = BoolProperty(name="Advanced Options", - description="Enables/disables advanced options for Rigify rig generation", - default=False) - - def update_mode(self, context): - if self.rigify_generate_mode == 'new': - self.rigify_force_widget_update = False - - bpy.types.Armature.rigify_generate_mode = EnumProperty(name="Rigify Generate Rig Mode", - description="'Generate Rig' mode. In 'overwrite' mode the features of the target rig will be updated as defined by the metarig. In 'new' mode a new rig will be created as defined by the metarig. Current mode", - update=update_mode, - items=( ('overwrite', 'overwrite', ''), - ('new', 'new', ''))) - bpy.types.Armature.rigify_force_widget_update = BoolProperty(name="Force Widget Update", description="Forces Rigify to delete and rebuild all the rig widgets. if unset, only missing widgets will be created", default=False) @@ -533,6 +519,9 @@ def register(): bpy.types.Armature.rigify_mirror_widgets = BoolProperty(name="Mirror Widgets", description="Make widgets for left and right side bones linked duplicates with negative X scale for the right side, based on bone name symmetry", default=True) + bpy.types.Armature.rigify_widgets_collection = PointerProperty(type=bpy.types.Collection, + name="Widgets Collection", + description="Defines which collection to place widget objects in. If unset, a new one will be created based on the name of the rig") bpy.types.Armature.rigify_target_rig = PointerProperty(type=bpy.types.Object, name="Rigify Target Rig", @@ -546,11 +535,6 @@ def register(): bpy.types.Armature.rigify_finalize_script = PointerProperty(type=bpy.types.Text, name="Finalize Script", description="Run this script after generation to apply user-specific changes") - - bpy.types.Armature.rigify_rig_basename = StringProperty(name="Rigify Rig Name", - description="Defines the name of the Rig. If unset, in 'new' mode 'rig' will be used, in 'overwrite' mode the target rig name will be used", - default="") - IDStore.rigify_transfer_only_selected = BoolProperty( name="Transfer Only Selected", description="Transfer selected bones only", default=True) @@ -592,12 +576,9 @@ def unregister(): del ArmStore.rigify_colors_index del ArmStore.rigify_colors_lock del ArmStore.rigify_theme_to_add - del ArmStore.rigify_advanced_generation - del ArmStore.rigify_generate_mode del ArmStore.rigify_force_widget_update del ArmStore.rigify_target_rig del ArmStore.rigify_rig_ui - del ArmStore.rigify_rig_basename IDStore = bpy.types.WindowManager del IDStore.rigify_collection diff --git a/rigify/generate.py b/rigify/generate.py index 501c335f..a674ade4 100644 --- a/rigify/generate.py +++ b/rigify/generate.py @@ -30,7 +30,7 @@ from .utils.widgets import WGT_PREFIX from .utils.widgets_special import create_root_widget from .utils.mechanism import refresh_all_drivers from .utils.misc import gamma_correct, select_object -from .utils.collections import ensure_widget_collection, list_layer_collections, filter_layer_collections_by_object +from .utils.collections import ensure_collection, list_layer_collections, filter_layer_collections_by_object from .utils.rig import get_rigify_type from . import base_generate @@ -55,9 +55,6 @@ class Generator(base_generate.BaseGenerator): self.id_store = context.window_manager - self.rig_new_name = "" - self.rig_old_name = "" - def find_rig_class(self, rig_type): rig_module = rig_lists.rigs[rig_type]["module"] @@ -76,55 +73,42 @@ class Generator(base_generate.BaseGenerator): self.collection = self.layer_collection.collection - def __create_rig_object(self): - scene = self.scene - id_store = self.id_store - meta_data = self.metarig.data - - # Check if the generated rig already exists, so we can - # regenerate in the same object. If not, create a new - # object to generate the rig in. + def ensure_rig_object(self) -> bpy.types.Object: + """Check if the generated rig already exists, so we can + regenerate in the same object. If not, create a new + object to generate the rig in. + """ print("Fetch rig.") + meta_data = self.metarig.data - self.rig_new_name = name = meta_data.rigify_rig_basename or "rig" - - obj = None - - # Try existing object if overwriting - if meta_data.rigify_generate_mode == 'overwrite': - obj = meta_data.rigify_target_rig - - if obj: - self.rig_old_name = obj.name - - obj.name = name - obj.data.name = obj.name - - elif name in bpy.data.objects: - obj = bpy.data.objects[name] + target_rig = meta_data.rigify_target_rig + if not target_rig: + if "metarig" in self.metarig.name: + rig_new_name = self.metarig.name.replace("metarig", "rig") + elif "META" in self.metarig.name: + rig_new_name = self.metarig.name.replace("META", "RIG") + else: + rig_new_name = "RIG-" + self.metarig.name - # Create a new object if not found - if not obj: - obj = bpy.data.objects.new(name, bpy.data.armatures.new(name)) - obj.display_type = 'WIRE' + target_rig = bpy.data.objects.new(rig_new_name, bpy.data.armatures.new(rig_new_name)) + target_rig.display_type = 'WIRE' # If the object is already added to the scene, switch to its collection - if obj.name in self.context.scene.collection.all_objects: - self.__switch_to_usable_collection(obj) + if target_rig.name in self.context.scene.collection.all_objects: + self.__switch_to_usable_collection(target_rig) else: # Otherwise, add to the selected collection or the metarig collection if unusable if (self.layer_collection not in self.usable_collections or self.layer_collection == self.view_layer.layer_collection): self.__switch_to_usable_collection(self.metarig, True) - self.collection.objects.link(obj) + self.collection.objects.link(target_rig) # Configure and remember the object - meta_data.rigify_target_rig = obj - obj.data.pose_position = 'POSE' + meta_data.rigify_target_rig = target_rig + target_rig.data.pose_position = 'POSE' - self.obj = obj - return obj + return target_rig def __unhide_rig_object(self, obj): @@ -144,11 +128,11 @@ class Generator(base_generate.BaseGenerator): raise Exception('Could not generate: Could not find a usable collection.') - def __create_widget_group(self): - new_group_name = "WGTS_" + self.obj.name - wgts_group_name = "WGTS_" + (self.rig_old_name or self.obj.name) - - # Find the old widgets collection + def __find_legacy_collection(self) -> bpy.types.Collection: + """For backwards comp, matching by name to find a legacy collection. + (For before there was a Widget Collection PointerProperty) + """ + wgts_group_name = "WGTS_" + self.obj.name old_collection = bpy.data.collections.get(wgts_group_name) if not old_collection: @@ -160,16 +144,22 @@ class Generator(base_generate.BaseGenerator): old_collection = legacy_collection if old_collection: - # Remove widgets if force update is set - if self.metarig.data.rigify_force_widget_update: - for obj in list(old_collection.objects): - bpy.data.objects.remove(obj) - # Rename the collection - old_collection.name = new_group_name + old_collection.name = wgts_group_name + + return old_collection + def ensure_widget_collection(self): # Create/find widget collection - self.widget_collection = ensure_widget_collection(self.context, new_group_name) + self.widget_collection = self.metarig.data.rigify_widgets_collection + if not self.widget_collection: + self.widget_collection = self.__find_legacy_collection() + if not self.widget_collection: + wgts_group_name = "WGTS_" + self.obj.name.replace("RIG-", "") + self.widget_collection = ensure_collection(self.context, wgts_group_name, hidden=True) + + self.metarig.data.rigify_widgets_collection = self.widget_collection + self.use_mirror_widgets = self.metarig.data.rigify_mirror_widgets # Build tables for existing widgets @@ -177,7 +167,11 @@ class Generator(base_generate.BaseGenerator): self.new_widget_table = {} self.widget_mirror_mesh = {} - if not self.metarig.data.rigify_force_widget_update and self.obj.pose: + if self.metarig.data.rigify_force_widget_update: + # Remove widgets if force update is set + for obj in list(self.widget_collection.objects): + bpy.data.objects.remove(obj) + elif self.obj.pose: # Find all widgets from the collection referenced by the old rig known_widgets = set(obj.name for obj in self.widget_collection.objects) @@ -430,7 +424,7 @@ class Generator(base_generate.BaseGenerator): #------------------------------------------ # Create/find the rig object and set it up - obj = self.__create_rig_object() + self.obj = obj = self.ensure_rig_object() self.__unhide_rig_object(obj) @@ -446,8 +440,8 @@ c @@ Diff output truncated at 10240 characters. @@ From noreply at git.blender.org Tue Dec 14 17:57:11 2021 From: noreply at git.blender.org (Iyad Ahmed) Date: Tue, 14 Dec 2021 17:57:11 +0100 (CET) Subject: [Bf-extensions-cvs] [cc971e50] blender-v2.93-release: Fix T77022: node wranger error with texture files on different drives In-Reply-To: <163950103107.72247.5100404194046966745@git.blender.org> References: <163950103107.72247.5100404194046966745@git.blender.org> Message-ID: <20211214165711.4D85E27EB1@git.blender.org> Commit: cc971e509d26484cc00bf89af7d2599d7dcab34e Author: Iyad Ahmed Date: Tue Aug 24 18:40:55 2021 +0200 Branches: blender-v2.93-release https://developer.blender.org/rBAcc971e509d26484cc00bf89af7d2599d7dcab34e Fix T77022: node wranger error with texture files on different drives Principled texture setup with relative path option would lead to this, silently use an absolute path instead like other Blender operators. Differential Revision: https://developer.blender.org/D12221 =================================================================== M node_wrangler.py =================================================================== diff --git a/node_wrangler.py b/node_wrangler.py index 118408c4..10b52967 100644 --- a/node_wrangler.py +++ b/node_wrangler.py @@ -3171,7 +3171,7 @@ class NWAddPrincipledSetup(Operator, NWBase, ImportHelper): relative_path: BoolProperty( name='Relative Path', - description='Select the file relative to the blend file', + description='Set the file path relative to the blend file, when possible', default=True ) @@ -3271,10 +3271,10 @@ class NWAddPrincipledSetup(Operator, NWBase, ImportHelper): import_path = self.directory if self.relative_path: if bpy.data.filepath: - import_path = bpy.path.relpath(self.directory) - else: - self.report({'WARNING'}, 'Relative paths cannot be used with unsaved scenes!') - print('Relative paths cannot be used with unsaved scenes!') + try: + import_path = bpy.path.relpath(self.directory) + except ValueError: + pass # Add found images print('\nMatched Textures:') From noreply at git.blender.org Fri Dec 17 08:52:17 2021 From: noreply at git.blender.org (Julien Duroure) Date: Fri, 17 Dec 2021 08:52:17 +0100 (CET) Subject: [Bf-extensions-cvs] [503570ad] master: glTF exporter: Fix T93929 - back compatibility for use_selection In-Reply-To: <163972753723.69584.8028388349233523259@git.blender.org> References: <163972753723.69584.8028388349233523259@git.blender.org> Message-ID: <20211217075217.816DA1E820@git.blender.org> Commit: 503570ad703268ef55cfa38beaa28ad15e3ecc57 Author: Julien Duroure Date: Fri Dec 17 08:51:31 2021 +0100 Branches: master https://developer.blender.org/rBA503570ad703268ef55cfa38beaa28ad15e3ecc57 glTF exporter: Fix T93929 - back compatibility for use_selection =================================================================== M io_scene_gltf2/__init__.py =================================================================== diff --git a/io_scene_gltf2/__init__.py b/io_scene_gltf2/__init__.py index 069596fa..c7c44c7c 100755 --- a/io_scene_gltf2/__init__.py +++ b/io_scene_gltf2/__init__.py @@ -15,7 +15,7 @@ bl_info = { 'name': 'glTF 2.0 format', 'author': 'Julien Duroure, Scurest, Norbert Nopper, Urs Hanselmann, Moritz Becher, Benjamin Schmithüsen, Jim Eckerlein, and many external contributors', - "version": (1, 8, 2), + "version": (1, 8, 3), 'blender': (3, 0, 0), 'location': 'File > Import-Export', 'description': 'Import-Export as glTF 2.0', @@ -461,14 +461,13 @@ class ExportGLTF2_Base: self.will_save_settings = False if settings: try: + if 'export_selected' in settings.keys(): # Back compatibility for export_selected --> use_selection + setattr(self, "use_selection", settings['export_selected']) + settings["use_selection"] = settings['export_selected'] + del settings['export_selected'] + print("export_selected is now renamed use_selection, and will be deleted in a few release") for (k, v) in settings.items(): - if k == "export_selected": # Back compatibility for export_selected --> use_selection - setattr(self, "use_selection", v) - del settings[k] - settings["use_selection"] = v - print("export_selected is now renamed use_selection, and will be deleted in a few release") - else: - setattr(self, k, v) + setattr(self, k, v) self.will_save_settings = True except (AttributeError, TypeError): @@ -503,7 +502,8 @@ class ExportGLTF2_Base: x: getattr(self, x) for x in dir(all_props) if (x.startswith("export_") or x in exceptional) and all_props.get(x) is not None } - + if 'export_selected' in export_props.keys(): + del export_props['export_selected'] # Do not save this property, only here for backward compatibility context.scene[self.scene_key] = export_props def execute(self, context): From noreply at git.blender.org Sat Dec 18 12:02:17 2021 From: noreply at git.blender.org (Julien Duroure) Date: Sat, 18 Dec 2021 12:02:17 +0100 (CET) Subject: [Bf-extensions-cvs] [f1c4959c] master: glTF exporter: fix regression when exporting armature object animation with only 1 key In-Reply-To: <163982533746.59065.15799166017026777738@git.blender.org> References: <163982533746.59065.15799166017026777738@git.blender.org> Message-ID: <20211218110217.BB8E53A7BA@git.blender.org> Commit: f1c4959cd05682855c6bfa0e96924f0b6a2676aa Author: Julien Duroure Date: Sat Dec 18 12:01:43 2021 +0100 Branches: master https://developer.blender.org/rBAf1c4959cd05682855c6bfa0e96924f0b6a2676aa glTF exporter: fix regression when exporting armature object animation with only 1 key =================================================================== M io_scene_gltf2/__init__.py M io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_channels.py =================================================================== diff --git a/io_scene_gltf2/__init__.py b/io_scene_gltf2/__init__.py index c7c44c7c..a3cc5287 100755 --- a/io_scene_gltf2/__init__.py +++ b/io_scene_gltf2/__init__.py @@ -15,7 +15,7 @@ bl_info = { 'name': 'glTF 2.0 format', 'author': 'Julien Duroure, Scurest, Norbert Nopper, Urs Hanselmann, Moritz Becher, Benjamin Schmithüsen, Jim Eckerlein, and many external contributors', - "version": (1, 8, 3), + "version": (1, 8, 4), 'blender': (3, 0, 0), 'location': 'File > Import-Export', 'description': 'Import-Export as glTF 2.0', diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_channels.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_channels.py index 3046a1ce..c60e7047 100755 --- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_channels.py +++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_animation_channels.py @@ -98,7 +98,7 @@ def gather_animation_channels(blender_action: bpy.types.Action, if len(channel_group) == 0: # Only errors on channels, ignoring continue - channel = __gather_animation_channel(channel_group, blender_object, export_settings, None, None, bake_range_start, bake_range_end, blender_action.name, None, False) + channel = __gather_animation_channel(channel_group, blender_object, export_settings, None, None, bake_range_start, bake_range_end, blender_action.name, None, True) if channel is not None: channels.append(channel) From noreply at git.blender.org Sat Dec 18 12:04:20 2021 From: noreply at git.blender.org (Julien Duroure) Date: Sat, 18 Dec 2021 12:04:20 +0100 (CET) Subject: [Bf-extensions-cvs] [f35aff34] master: glTF exporter: Manage tweak mode in NLA when needed In-Reply-To: <163982546001.61065.15532844814618289820@git.blender.org> References: <163982546001.61065.15532844814618289820@git.blender.org> Message-ID: <20211218110420.493183A7DC@git.blender.org> Commit: f35aff344ff651364a54cc6c9fa75bf2699ad2a8 Author: Julien Duroure Date: Sat Dec 18 12:03:58 2021 +0100 Branches: master https://developer.blender.org/rBAf35aff344ff651364a54cc6c9fa75bf2699ad2a8 glTF exporter: Manage tweak mode in NLA when needed =================================================================== M io_scene_gltf2/__init__.py M io_scene_gltf2/blender/exp/gltf2_blender_gather_animations.py =================================================================== diff --git a/io_scene_gltf2/__init__.py b/io_scene_gltf2/__init__.py index a3cc5287..954098eb 100755 --- a/io_scene_gltf2/__init__.py +++ b/io_scene_gltf2/__init__.py @@ -15,7 +15,7 @@ bl_info = { 'name': 'glTF 2.0 format', 'author': 'Julien Duroure, Scurest, Norbert Nopper, Urs Hanselmann, Moritz Becher, Benjamin Schmithüsen, Jim Eckerlein, and many external contributors', - "version": (1, 8, 4), + "version": (1, 8, 5), 'blender': (3, 0, 0), 'location': 'File > Import-Export', 'description': 'Import-Export as glTF 2.0', diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gather_animations.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather_animations.py index 819c8085..abd498df 100755 --- a/io_scene_gltf2/blender/exp/gltf2_blender_gather_animations.py +++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather_animations.py @@ -52,6 +52,10 @@ def gather_animations(blender_object: bpy.types.Object, track.is_solo = False break + # Remove any tweak mode. Restore after export + if blender_object.animation_data: + restore_tweak_mode = blender_object.animation_data.use_tweak_mode + # Export all collected actions. for blender_action, track_name, on_type in blender_actions: @@ -60,10 +64,7 @@ def gather_animations(blender_object: bpy.types.Object, if blender_object.animation_data.action is None \ or (blender_object.animation_data.action.name != blender_action.name): if blender_object.animation_data.is_property_readonly('action'): - # NLA stuff: some track are on readonly mode, we can't change action - error = "Action is readonly. Please check NLA editor" - print_console("WARNING", "Animation '{}' could not be exported. Cause: {}".format(blender_action.name, error)) - continue + blender_object.animation_data.use_tweak_mode = False try: blender_object.animation_data.action = blender_action except: @@ -97,7 +98,7 @@ def gather_animations(blender_object: bpy.types.Object, blender_object.animation_data.action = current_action if solo_track is not None: solo_track.is_solo = True - + blender_object.animation_data.use_tweak_mode = restore_tweak_mode return animations, tracks From noreply at git.blender.org Sat Dec 18 12:05:39 2021 From: noreply at git.blender.org (Julien Duroure) Date: Sat, 18 Dec 2021 12:05:39 +0100 (CET) Subject: [Bf-extensions-cvs] [c2eeb9bb] master: glTF importer: performance enhancement when images are packed In-Reply-To: <163982553919.62597.3176749933287963995@git.blender.org> References: <163982553919.62597.3176749933287963995@git.blender.org> Message-ID: <20211218110539.6A7E13AA70@git.blender.org> Commit: c2eeb9bb4732602c324a011f7f913a33a5e8b1f2 Author: Julien Duroure Date: Sat Dec 18 12:05:05 2021 +0100 Branches: master https://developer.blender.org/rBAc2eeb9bb4732602c324a011f7f913a33a5e8b1f2 glTF importer: performance enhancement when images are packed =================================================================== M io_scene_gltf2/__init__.py M io_scene_gltf2/blender/imp/gltf2_blender_image.py =================================================================== diff --git a/io_scene_gltf2/__init__.py b/io_scene_gltf2/__init__.py index 954098eb..3fbc9239 100755 --- a/io_scene_gltf2/__init__.py +++ b/io_scene_gltf2/__init__.py @@ -15,7 +15,7 @@ bl_info = { 'name': 'glTF 2.0 format', 'author': 'Julien Duroure, Scurest, Norbert Nopper, Urs Hanselmann, Moritz Becher, Benjamin Schmithüsen, Jim Eckerlein, and many external contributors', - "version": (1, 8, 5), + "version": (1, 8, 6), 'blender': (3, 0, 0), 'location': 'File > Import-Export', 'description': 'Import-Export as glTF 2.0', diff --git a/io_scene_gltf2/blender/imp/gltf2_blender_image.py b/io_scene_gltf2/blender/imp/gltf2_blender_image.py index 7f523922..082e5665 100755 --- a/io_scene_gltf2/blender/imp/gltf2_blender_image.py +++ b/io_scene_gltf2/blender/imp/gltf2_blender_image.py @@ -38,54 +38,54 @@ class BlenderImage(): # Image is already used somewhere return - tmp_dir = None + is_binary = False is_placeholder = False + + num_images = len(bpy.data.images) + try: + if img.uri is not None and not img.uri.startswith('data:'): # Image stored in a file path = join(dirname(gltf.filename), _uri_to_path(img.uri)) img_name = img_name or basename(path) + try: + blender_image = bpy.data.images.load( + os.path.abspath(path), + check_existing=True, + ) + except RuntimeError: + gltf.log.error("Missing image file (index %d): %s" % (img_idx, path)) + blender_image = _placeholder_image(img_name, os.path.abspath(path)) + is_placeholder = True + else: # Image stored as data => create a tempfile, pack, and delete file + is_binary = True img_data = BinaryData.get_image_data(gltf, img_idx) if img_data is None: return - img_name = img_name or 'Image_%d' % img_idx - tmp_dir = tempfile.TemporaryDirectory(prefix='gltfimg-') - filename = _filenamify(img_name) or 'Image_%d' % img_idx - filename += _img_extension(img) - path = join(tmp_dir.name, filename) - with open(path, 'wb') as f: - f.write(img_data) - - num_images = len(bpy.data.images) - - try: - blender_image = bpy.data.images.load( - os.path.abspath(path), - check_existing=tmp_dir is None, - ) - except RuntimeError: - gltf.log.error("Missing image file (index %d): %s" % (img_idx, path)) - blender_image = _placeholder_image(img_name, os.path.abspath(path)) - is_placeholder = True - - if len(bpy.data.images) != num_images: # If created a new image - blender_image.name = img_name - - needs_pack = ( - gltf.import_settings['import_pack_images'] or - tmp_dir is not None - ) - if not is_placeholder and needs_pack: - blender_image.pack() - - img.blender_image_name = blender_image.name - - finally: - if tmp_dir is not None: - tmp_dir.cleanup() + img_name = 'Image_%d' % img_idx + + # Create image, width and height are dummy values + img_pack = bpy.data.images.new(img_name, 8, 8) + # Set packed file data + img_pack.pack(data=img_data.tobytes(), data_len=len(img_data)) + img_pack.source = 'FILE' + img.blender_image_name = img_pack.name + + if is_binary is False: + if len(bpy.data.images) != num_images: # If created a new image + blender_image.name = img_name + img.blender_image_name = img_name + + needs_pack = gltf.import_settings['import_pack_images'] + if not is_placeholder and needs_pack: + blender_image.pack() + except: + print("Unknown error loading texture") + def _placeholder_image(name, path): image = bpy.data.images.new(name, 128, 128) @@ -97,14 +97,3 @@ def _placeholder_image(name, path): def _uri_to_path(uri): uri = urllib.parse.unquote(uri) return normpath(uri) - -def _img_extension(img): - if img.mime_type == 'image/png': - return '.png' - if img.mime_type == 'image/jpeg': - return '.jpg' - return '' - -def _filenamify(s): - s = s.strip().replace(' ', '_') - return re.sub(r'(?u)[^-\w.]', '', s) From noreply at git.blender.org Wed Dec 22 11:03:55 2021 From: noreply at git.blender.org (Adam Dominec) Date: Wed, 22 Dec 2021 11:03:55 +0100 (CET) Subject: [Bf-extensions-cvs] [8e194b49] master: Export Paper Model: fix ambient occlusion In-Reply-To: <164016743566.26738.17084111844314095521@git.blender.org> References: <164016743566.26738.17084111844314095521@git.blender.org> Message-ID: <20211222100355.DCBFA7B5E@git.blender.org> Commit: 8e194b49d8a20559cac7fc37edb7782bd36d03e7 Author: Adam Dominec Date: Wed Dec 22 11:03:21 2021 +0100 Branches: master https://developer.blender.org/rBA8e194b49d8a20559cac7fc37edb7782bd36d03e7 Export Paper Model: fix ambient occlusion =================================================================== M io_export_paper_model.py =================================================================== diff --git a/io_export_paper_model.py b/io_export_paper_model.py index f92d940f..022971f8 100644 --- a/io_export_paper_model.py +++ b/io_export_paper_model.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # This script is Free software. Please share and reuse. -# ♡2010-2020 Adam Dominec +# ♡2010-2021 Adam Dominec ## Code structure # This file consists of several components, in this order: @@ -13,7 +13,7 @@ bl_info = { "name": "Export Paper Model", "author": "Addam Dominec", "version": (1, 2), - "blender": (2, 83, 0), + "blender": (3, 0, 0), "location": "File > Export > Paper Model", "warning": "", "description": "Export printable net of the active mesh", @@ -253,7 +253,7 @@ class Unfolder: bk = rd.bake recall = store_rna_properties(rd, bk, sce.cycles) rd.engine = 'CYCLES' - for p in ('ambient_occlusion', 'color', 'diffuse', 'direct', 'emit', 'glossy', 'indirect', 'transmission'): + for p in ('color', 'diffuse', 'direct', 'emit', 'glossy', 'indirect', 'transmission'): setattr(bk, f"use_pass_{p}", (properties.output_type != 'TEXTURE')) lookup = {'TEXTURE': 'DIFFUSE', 'AMBIENT_OCCLUSION': 'AO', 'RENDER': 'COMBINED', 'SELECTED_TO_ACTIVE': 'COMBINED'} sce.cycles.bake_type = lookup[properties.output_type] @@ -266,7 +266,7 @@ class Unfolder: sce.cycles.samples = properties.bake_samples if sce.cycles.bake_type == 'COMBINED': bk.use_pass_direct, bk.use_pass_indirect = True, True - bk.use_pass_diffuse, bk.use_pass_glossy, bk.use_pass_transmission, bk.use_pass_ambient_occlusion, bk.use_pass_emit = True, False, False, True, True + bk.use_pass_diffuse, bk.use_pass_glossy, bk.use_pass_transmission, bk.use_pass_emit = True, False, False, True if image_packing == 'PAGE_LINK': self.mesh.save_image(printable_size * ppm, filepath) From noreply at git.blender.org Mon Dec 27 15:44:20 2021 From: noreply at git.blender.org (Andreas Plesch) Date: Mon, 27 Dec 2021 15:44:20 +0100 (CET) Subject: [Bf-extensions-cvs] [1679f2fd] master: Fix T94122: Export to X3D Fails. In-Reply-To: <164061626042.32760.4487895562008996228@git.blender.org> References: <164061626042.32760.4487895562008996228@git.blender.org> Message-ID: <20211227144420.A2702378BC@git.blender.org> Commit: 1679f2fdbb1373a255b98b69c6dc2f8a90e7170a Author: Andreas Plesch Date: Mon Dec 27 15:41:38 2021 +0100 Branches: master https://developer.blender.org/rBA1679f2fdbb1373a255b98b69c6dc2f8a90e7170a Fix T94122: Export to X3D Fails. Fixes call to `create_derived_objects()` in x3d export. rBa82c9e1e405c84b9 introduced a change in the signature and return value of the `create_derived_objects()` utility. This change lead to failure of the x3d export addon. Reviewed By: mont29 Differential Revision: https://developer.blender.org/D13667 =================================================================== M io_scene_x3d/export_x3d.py =================================================================== diff --git a/io_scene_x3d/export_x3d.py b/io_scene_x3d/export_x3d.py index 746567f8..6a4daf91 100644 --- a/io_scene_x3d/export_x3d.py +++ b/io_scene_x3d/export_x3d.py @@ -1378,7 +1378,8 @@ def export(file, def export_object(ident, obj_main_parent, obj_main, obj_children): matrix_fallback = mathutils.Matrix() world = scene.world - free, derived = create_derived_objects(scene, obj_main) + derived_dict = create_derived_objects(depsgraph, [obj_main]) + derived = derived_dict.get(obj_main) if use_hierarchy: obj_main_matrix_world = obj_main.matrix_world From noreply at git.blender.org Fri Dec 31 09:35:36 2021 From: noreply at git.blender.org (Mikhail Rachinskiy) Date: Fri, 31 Dec 2021 09:35:36 +0100 (CET) Subject: [Bf-extensions-cvs] [5533f703] master: PLY: Fix export faces with more than 255 sides In-Reply-To: <164093973685.64902.6974516380521741352@git.blender.org> References: <164093973685.64902.6974516380521741352@git.blender.org> Message-ID: <20211231083537.19F813DD5A@git.blender.org> Commit: 5533f703fb6e2f5c1eb42734b763185e89a8f324 Author: Mikhail Rachinskiy Date: Fri Dec 31 12:26:59 2021 +0400 Branches: master https://developer.blender.org/rBA5533f703fb6e2f5c1eb42734b763185e89a8f324 PLY: Fix export faces with more than 255 sides Ideally we want to use uint16 or uint32 data type for this purpose, but certain DCCs have hardcoded uint8 limits in their PLY importers. Silently tringulating faces with many sides is bad, but it's even worse when correctly exported model won't load because of poor importer implementation in other DCCs. =================================================================== M io_mesh_ply/export_ply.py =================================================================== diff --git a/io_mesh_ply/export_ply.py b/io_mesh_ply/export_ply.py index 060b3d02..e86f43f3 100644 --- a/io_mesh_ply/export_ply.py +++ b/io_mesh_ply/export_ply.py @@ -244,6 +244,10 @@ def save( bm.from_mesh(me) ob_eval.to_mesh_clear() + # Workaround for hardcoded unsigned char limit in other DCCs PLY importers + if (ngons := [f for f in bm.faces if len(f.verts) > 255]): + bmesh.ops.triangulate(bm, faces=ngons) + mesh = bpy.data.meshes.new("TMP PLY EXPORT") bm.to_mesh(mesh) bm.free() From noreply at git.blender.org Fri Dec 31 09:47:13 2021 From: noreply at git.blender.org (Mikhail Rachinskiy) Date: Fri, 31 Dec 2021 09:47:13 +0100 (CET) Subject: [Bf-extensions-cvs] [5df5a211] master: PLY: Cleanup and simplify collecting faces info In-Reply-To: <164094043351.77996.14052347303817366891@git.blender.org> References: <164094043351.77996.14052347303817366891@git.blender.org> Message-ID: <20211231084713.C24F23E011@git.blender.org> Commit: 5df5a211c5f02cead0630715b78d24549bbf9749 Author: Mikhail Rachinskiy Date: Fri Dec 31 12:40:57 2021 +0400 Branches: master https://developer.blender.org/rBA5df5a211c5f02cead0630715b78d24549bbf9749 PLY: Cleanup and simplify collecting faces info =================================================================== M io_mesh_ply/export_ply.py =================================================================== diff --git a/io_mesh_ply/export_ply.py b/io_mesh_ply/export_ply.py index e86f43f3..d90c0e49 100644 --- a/io_mesh_ply/export_ply.py +++ b/io_mesh_ply/export_ply.py @@ -24,7 +24,15 @@ colors, and texture coordinates per face or per vertex. """ -def _write_binary(fw, ply_verts, ply_faces, mesh_verts): +class _PLYface: + __slots__ = "verts", "sides" + + def __init__(self, sides: int) -> None: + self.verts = [] + self.sides = sides + + +def _write_binary(fw, ply_verts: list, ply_faces: list[_PLYface], mesh_verts: list) -> None: from struct import pack # Vertex data @@ -43,11 +51,10 @@ def _write_binary(fw, ply_verts, ply_faces, mesh_verts): # --------------------------- for pf in ply_faces: - length = len(pf) - fw(pack(" None: # Vertex data # --------------------------- @@ -66,8 +73,8 @@ def _write_ascii(fw, ply_verts, ply_faces, mesh_verts): # --------------------------- for pf in ply_faces: - fw(b"%d" % len(pf)) - for index in pf: + fw(b"%d" % pf.sides) + for index in pf.verts: fw(b" %d" % index) fw(b"\n") @@ -96,12 +103,12 @@ def save_mesh(filepath, mesh, use_ascii, use_normals, use_uv_coords, use_colors) mesh_verts = mesh.vertices # vdict = {} # (index, normal, uv) -> new index - vdict = [{} for i in range(len(mesh_verts))] + vdict = [{} for _ in range(len(mesh_verts))] ply_verts = [] - ply_faces = [[] for f in range(len(mesh.polygons))] + ply_faces = [] vert_count = 0 - for i, f in enumerate(mesh.polygons): + for f in mesh.polygons: if use_normals: smooth = f.use_smooth @@ -120,8 +127,8 @@ def save_mesh(filepath, mesh, use_ascii, use_normals, use_uv_coords, use_colors) for l in range(f.loop_start, f.loop_start + f.loop_total) ] - pf = ply_faces[i] - for j, vidx in enumerate(f.vertices): + pf = _PLYface(f.loop_total) + for i, vidx in enumerate(f.vertices): v = mesh_verts[vidx] if use_normals and smooth: @@ -129,11 +136,11 @@ def save_mesh(filepath, mesh, use_ascii, use_normals, use_uv_coords, use_colors) normal_key = rvec3d(normal) if use_uv_coords: - uvcoord = uv[j][0], uv[j][1] + uvcoord = uv[i][0], uv[i][1] uvcoord_key = rvec2d(uvcoord) if use_colors: - color = col[j] + color = col[i] color = ( int(color[0] * 255.0), int(color[1] * 255.0), @@ -150,7 +157,9 @@ def save_mesh(filepath, mesh, use_ascii, use_normals, use_uv_coords, use_colors) ply_verts.append((vidx, normal, uvcoord, color)) vert_count += 1 - pf.append(pf_vidx) + pf.verts.append(pf_vidx) + + ply_faces.append(pf) with open(filepath, "wb") as file: fw = file.write From noreply at git.blender.org Fri Dec 31 11:36:56 2021 From: noreply at git.blender.org (Alexander Gavrilov) Date: Fri, 31 Dec 2021 11:36:56 +0100 (CET) Subject: [Bf-extensions-cvs] [231186d4] master: Rigify: clear the script datablock when re-generating. In-Reply-To: <164094701673.90382.5403214559213576964@git.blender.org> References: <164094701673.90382.5403214559213576964@git.blender.org> Message-ID: <20211231103656.EF02040272@git.blender.org> Commit: 231186d45fe8998729e594a7683fd19d30ce8a2c Author: Alexander Gavrilov Date: Fri Dec 31 13:36:53 2021 +0300 Branches: master https://developer.blender.org/rBA231186d45fe8998729e594a7683fd19d30ce8a2c Rigify: clear the script datablock when re-generating. =================================================================== M rigify/rig_ui_template.py =================================================================== diff --git a/rigify/rig_ui_template.py b/rigify/rig_ui_template.py index 8780461d..06ff7faf 100644 --- a/rigify/rig_ui_template.py +++ b/rigify/rig_ui_template.py @@ -1168,7 +1168,10 @@ class ScriptGenerator(base_generate.GeneratorPlugin): # Generate the UI script script = metarig.data.rigify_rig_ui - if not script: + + if script: + script.clear() + else: script = bpy.data.texts.new("rig_ui.py") metarig.data.rigify_rig_ui = script