Pose Library: Update to use the asset shelf (when enabled) #104546

Merged
Julian Eisel merged 33 commits from asset-shelf into main 2023-08-04 15:00:21 +02:00
13 changed files with 47 additions and 37 deletions
Showing only changes of commit 9aa77345ec - Show all commits

View File

@ -1,7 +1,9 @@
name: Add-on Bug Report name: Add-on Bug Report
about: File a bug report for an add-on bundled with Blender about: File a bug report for an add-on bundled with Blender
labels: labels:
- type::Report - "Type/Report"
- "Status/Needs Triage"
- "Priority/Normal"
body: body:
- type: markdown - type: markdown
attributes: attributes:

View File

@ -6,7 +6,7 @@ bl_info = {
"version": (4, 37, 5), "version": (4, 37, 5),
"blender": (3, 4, 0), "blender": (3, 4, 0),
"location": "File > Import-Export", "location": "File > Import-Export",
"description": "FBX IO meshes, UV's, vertex colors, materials, textures, cameras, lamps and actions", "description": "FBX IO meshes, UVs, vertex colors, materials, textures, cameras, lamps and actions",
"warning": "", "warning": "",
"doc_url": "{BLENDER_MANUAL_URL}/addons/import_export/scene_fbx.html", "doc_url": "{BLENDER_MANUAL_URL}/addons/import_export/scene_fbx.html",
"support": 'OFFICIAL', "support": 'OFFICIAL',

View File

@ -1068,7 +1068,7 @@ def blen_read_geom_layer_color(fbx_obj, mesh, colors_type):
use_srgb = colors_type == 'SRGB' use_srgb = colors_type == 'SRGB'
layer_type = 'BYTE_COLOR' if use_srgb else 'FLOAT_COLOR' layer_type = 'BYTE_COLOR' if use_srgb else 'FLOAT_COLOR'
color_prop_name = "color_srgb" if use_srgb else "color" color_prop_name = "color_srgb" if use_srgb else "color"
# almost same as UV's # almost same as UVs
for layer_id in (b'LayerElementColor',): for layer_id in (b'LayerElementColor',):
for fbx_layer in elem_find_iter(fbx_obj, layer_id): for fbx_layer in elem_find_iter(fbx_obj, layer_id):
# all should be valid # all should be valid

View File

@ -4,7 +4,7 @@
bl_info = { bl_info = {
'name': 'glTF 2.0 format', 'name': 'glTF 2.0 format',
'author': 'Julien Duroure, Scurest, Norbert Nopper, Urs Hanselmann, Moritz Becher, Benjamin Schmithüsen, Jim Eckerlein, and many external contributors', 'author': 'Julien Duroure, Scurest, Norbert Nopper, Urs Hanselmann, Moritz Becher, Benjamin Schmithüsen, Jim Eckerlein, and many external contributors',
"version": (3, 6, 3), "version": (3, 6, 4),
'blender': (3, 5, 0), 'blender': (3, 5, 0),
'location': 'File > Import-Export', 'location': 'File > Import-Export',
'description': 'Import-Export as glTF 2.0', 'description': 'Import-Export as glTF 2.0',
@ -272,7 +272,7 @@ class ExportGLTF2_Base(ConvertGLTF2_Base):
export_draco_generic_quantization: IntProperty( export_draco_generic_quantization: IntProperty(
name='Generic quantization bits', name='Generic quantization bits',
description='Quantization bits for generic coordinate values like weights or joints (0 = no quantization)', description='Quantization bits for generic values like weights or joints (0 = no quantization)',
default=12, default=12,
min=0, min=0,
max=30 max=30

View File

@ -857,7 +857,7 @@ class PrimitiveCreator:
# Morph tangent are after these 3 others, so, they are already calculated # Morph tangent are after these 3 others, so, they are already calculated
self.normals = self.attributes[attr['gltf_attribute_name_normal']]["data"] self.normals = self.attributes[attr['gltf_attribute_name_normal']]["data"]
self.morph_normals = self.attributes[attr['gltf_attribute_name_morph_normal']]["data"] self.morph_normals = self.attributes[attr['gltf_attribute_name_morph_normal']]["data"]
self.tangent = self.attributes[attr['gltf_attribute_name_tangent']]["data"] self.tangents = self.attributes[attr['gltf_attribute_name_tangent']]["data"]
self.__calc_morph_tangents() self.__calc_morph_tangents()
self.attributes[attr['gltf_attribute_name']] = {} self.attributes[attr['gltf_attribute_name']] = {}
@ -865,18 +865,18 @@ class PrimitiveCreator:
def __calc_morph_tangents(self): def __calc_morph_tangents(self):
# TODO: check if this works # TODO: check if this works
self.morph_tangent_deltas = np.empty((len(self.normals), 3), dtype=np.float32) self.morph_tangents = np.empty((len(self.normals), 3), dtype=np.float32)
for i in range(len(self.normals)): for i in range(len(self.normals)):
n = Vector(self.normals[i]) n = Vector(self.normals[i])
morph_n = n + Vector(self.morph_normal_deltas[i]) # convert back to non-delta morph_n = n + Vector(self.morph_normals[i]) # convert back to non-delta
t = Vector(self.tangents[i, :3]) t = Vector(self.tangents[i, :3])
rotation = morph_n.rotation_difference(n) rotation = morph_n.rotation_difference(n)
t_morph = Vector(t) t_morph = Vector(t)
t_morph.rotate(rotation) t_morph.rotate(rotation)
self.morph_tangent_deltas[i] = t_morph - t # back to delta self.morph_tangents[i] = t_morph - t # back to delta
def __set_regular_attribute(self, attr): def __set_regular_attribute(self, attr):
res = np.empty((len(self.prim_dots), attr['len']), dtype=attr['type']) res = np.empty((len(self.prim_dots), attr['len']), dtype=attr['type'])

View File

@ -6,7 +6,7 @@ bl_info = {
"version": (3, 9, 0), "version": (3, 9, 0),
"blender": (3, 0, 0), "blender": (3, 0, 0),
"location": "File > Import-Export", "location": "File > Import-Export",
"description": "Import-Export OBJ, Import OBJ mesh, UV's, materials and textures", "description": "Import-Export OBJ, Import OBJ mesh, UVs, materials and textures",
"warning": "", "warning": "",
"doc_url": "{BLENDER_MANUAL_URL}/addons/import_export/scene_obj.html", "doc_url": "{BLENDER_MANUAL_URL}/addons/import_export/scene_obj.html",
"support": 'OFFICIAL', "support": 'OFFICIAL',

View File

@ -452,10 +452,10 @@ def write_file(filepath, objects, depsgraph, scene,
uv_ls = uv_face_mapping[f_index] = [] uv_ls = uv_face_mapping[f_index] = []
for uv_index, l_index in enumerate(f.loop_indices): for uv_index, l_index in enumerate(f.loop_indices):
uv = uv_layer[l_index].uv uv = uv_layer[l_index].uv
# include the vertex index in the key so we don't share UV's between vertices, # include the vertex index in the key so we don't share UVs between vertices,
# allowed by the OBJ spec but can cause issues for other importers, see: T47010. # allowed by the OBJ spec but can cause issues for other importers, see: T47010.
# this works too, shared UV's for all verts # this works too, shared UVs for all verts
#~ uv_key = veckey2d(uv) #~ uv_key = veckey2d(uv)
uv_key = loops[l_index].vertex_index, veckey2d(uv) uv_key = loops[l_index].vertex_index, veckey2d(uv)
@ -596,7 +596,7 @@ def write_file(filepath, objects, depsgraph, scene,
face_vert_index += len(f_v) face_vert_index += len(f_v)
else: # No UV's else: # No UVs
if EXPORT_NORMALS: if EXPORT_NORMALS:
for vi, v, li in f_v: for vi, v, li in f_v:
fw(" %d//%d" % (totverts + v.index, totno + loops_to_normals[li])) fw(" %d//%d" % (totverts + v.index, totno + loops_to_normals[li]))

View File

@ -64,7 +64,7 @@ class _Properties:
) )
scene.muv_select_uv_sync_mesh_selection = BoolProperty( scene.muv_select_uv_sync_mesh_selection = BoolProperty(
name="Sync Mesh Selection", name="Sync Mesh Selection",
description="Select the mesh's faces as well as UV's faces", description="Select the mesh's faces as well as UVs' faces",
default=False default=False
) )
@ -106,7 +106,7 @@ class MUV_OT_SelectUV_SelectOverlapped(bpy.types.Operator):
) )
sync_mesh_selection = BoolProperty( sync_mesh_selection = BoolProperty(
name="Sync Mesh Selection", name="Sync Mesh Selection",
description="Select mesh's faces as well as UV's faces", description="Select the mesh's faces as well as UVs' faces",
default=False default=False
) )
@ -199,7 +199,7 @@ class MUV_OT_SelectUV_SelectFlipped(bpy.types.Operator):
) )
sync_mesh_selection = BoolProperty( sync_mesh_selection = BoolProperty(
name="Sync Mesh Selection", name="Sync Mesh Selection",
description="Select mesh's faces as well as UV's faces", description="Select the mesh's faces as well as UVs' faces",
default=False default=False
) )

View File

@ -2020,7 +2020,7 @@ class NWMergeNodes(Operator, NWBase):
mode = 'MIX' mode = 'MIX'
if (merge_type != 'MATH' and merge_type != 'GEOMETRY') and tree_type == 'GEOMETRY': if (merge_type != 'MATH' and merge_type != 'GEOMETRY') and tree_type == 'GEOMETRY':
merge_type = 'AUTO' merge_type = 'AUTO'
# The MixRGB node and math nodes used for geometry nodes are of type 'ShaderNode' # The Mix node and math nodes used for geometry nodes are of type 'ShaderNode'
if (merge_type == 'MATH' or merge_type == 'MIX') and tree_type == 'GEOMETRY': if (merge_type == 'MATH' or merge_type == 'MIX') and tree_type == 'GEOMETRY':
node_type = 'ShaderNode' node_type = 'ShaderNode'
selected_mix = [] # entry = [index, loc] selected_mix = [] # entry = [index, loc]
@ -2119,8 +2119,13 @@ class NWMergeNodes(Operator, NWBase):
was_multi = False was_multi = False
for i in range(the_range): for i in range(the_range):
if nodes_list == selected_mix: if nodes_list == selected_mix:
add_type = node_type + 'MixRGB' mix_name = 'Mix'
if tree_type == 'COMPOSITING':
mix_name = 'MixRGB'
add_type = node_type + mix_name
add = nodes.new(add_type) add = nodes.new(add_type)
if tree_type != 'COMPOSITING':
add.data_type = 'RGBA'
add.blend_type = mode add.blend_type = mode
if mode != 'MIX': if mode != 'MIX':
add.inputs[0].default_value = 1.0 add.inputs[0].default_value = 1.0
@ -2128,6 +2133,9 @@ class NWMergeNodes(Operator, NWBase):
add.hide = do_hide add.hide = do_hide
if do_hide: if do_hide:
loc_y = loc_y - 50 loc_y = loc_y - 50
first = 6
second = 7
if tree_type == 'COMPOSITING':
first = 1 first = 1
second = 2 second = 2
add.width_hidden = 100.0 add.width_hidden = 100.0
@ -2290,7 +2298,7 @@ class NWBatchChangeNodes(Operator, NWBase):
blend_type = self.blend_type blend_type = self.blend_type
operation = self.operation operation = self.operation
for node in context.selected_nodes: for node in context.selected_nodes:
if node.type == 'MIX_RGB' or node.bl_idname == 'GeometryNodeAttributeMix': if node.type == 'MIX_RGB' or (node.bl_idname == 'ShaderNodeMix' and node.data_type == 'RGBA'):
if not blend_type in [nav[0] for nav in navs]: if not blend_type in [nav[0] for nav in navs]:
node.blend_type = blend_type node.blend_type = blend_type
else: else:
@ -2309,7 +2317,7 @@ class NWBatchChangeNodes(Operator, NWBase):
else: else:
node.blend_type = blend_types[index - 1][0] node.blend_type = blend_types[index - 1][0]
if node.type == 'MATH' or node.bl_idname == 'GeometryNodeAttributeMath': if node.type == 'MATH' or node.bl_idname == 'ShaderNodeMath':
if not operation in [nav[0] for nav in navs]: if not operation in [nav[0] for nav in navs]:
node.operation = operation node.operation = operation
else: else:
@ -2349,7 +2357,7 @@ class NWChangeMixFactor(Operator, NWBase):
selected = [] # entry = index selected = [] # entry = index
for si, node in enumerate(nodes): for si, node in enumerate(nodes):
if node.select: if node.select:
if node.type in {'MIX_RGB', 'MIX_SHADER'}: if node.type in {'MIX_RGB', 'MIX_SHADER'} or node.bl_idname == 'ShaderNodeMix':
selected.append(si) selected.append(si)
for si in selected: for si in selected:

View File

@ -4,8 +4,8 @@ bl_info = {
"name": "Hotkey: 'Ctrl Alt S' ", "name": "Hotkey: 'Ctrl Alt S' ",
"description": "Switch Editor Type Menu", "description": "Switch Editor Type Menu",
"author": "saidenka, meta-androcto", "author": "saidenka, meta-androcto",
"version": (0, 1, 1), "version": (0, 1, 2),
"blender": (2, 80, 0), "blender": (3, 40, 1),
"location": "All Editors", "location": "All Editors",
"warning": "", "warning": "",
"doc_url": "", "doc_url": "",
@ -64,7 +64,7 @@ class PIE_MT_AreaTypePieOther(Menu):
self.layout.operator( self.layout.operator(
PIE_OT_SetAreaType.bl_idname, PIE_OT_SetAreaType.bl_idname,
text="File Browser", text="File Browser",
icon="FILEBROWSER").types = "FILE_BROWSER" icon="FILEBROWSER").types = "FILES"
self.layout.operator(PIE_OT_SetAreaType.bl_idname, text="Preferences", self.layout.operator(PIE_OT_SetAreaType.bl_idname, text="Preferences",
icon="PREFERENCES").types = "PREFERENCES" icon="PREFERENCES").types = "PREFERENCES"
self.layout.operator(PIE_OT_SetAreaType.bl_idname, text="Text Editor", icon="TEXT").types = "TEXT_EDITOR" self.layout.operator(PIE_OT_SetAreaType.bl_idname, text="Text Editor", icon="TEXT").types = "TEXT_EDITOR"

View File

@ -3,7 +3,7 @@
bl_info = { bl_info = {
"name": "VR Scene Inspection", "name": "VR Scene Inspection",
"author": "Julian Eisel (Severin), Sebastian Koenig, Peter Kim (muxed-reality)", "author": "Julian Eisel (Severin), Sebastian Koenig, Peter Kim (muxed-reality)",
"version": (0, 11, 1), "version": (0, 11, 2),
"blender": (3, 2, 0), "blender": (3, 2, 0),
"location": "3D View > Sidebar > VR", "location": "3D View > Sidebar > VR",
"description": ("View the viewport with virtual reality glasses " "description": ("View the viewport with virtual reality glasses "

View File

@ -7,6 +7,7 @@ else:
from . import properties from . import properties
import bpy import bpy
from bpy.app.translations import pgettext_iface as iface_
from bpy.types import ( from bpy.types import (
Menu, Menu,
Panel, Panel,
@ -37,12 +38,10 @@ class VIEW3D_PT_vr_session(Panel):
# Using SNAP_FACE because it looks like a stop icon -- I shouldn't # Using SNAP_FACE because it looks like a stop icon -- I shouldn't
# have commit rights... # have commit rights...
toggle_info = ( toggle_info = ((iface_("Start VR Session"), 'PLAY') if not is_session_running
("Start VR Session", 'PLAY') if not is_session_running else ( else (iface_("Stop VR Session"), 'SNAP_FACE'))
"Stop VR Session", 'SNAP_FACE') layout.operator("wm.xr_session_toggle", text=toggle_info[0],
) translate=False, icon=toggle_info[1])
layout.operator("wm.xr_session_toggle",
text=toggle_info[0], icon=toggle_info[1])
layout.separator() layout.separator()

View File

@ -8,6 +8,7 @@ else:
import bpy import bpy
import gpu import gpu
from bpy.app.translations import pgettext_data as data_
from bpy.types import ( from bpy.types import (
Gizmo, Gizmo,
GizmoGroup, GizmoGroup,
@ -117,8 +118,8 @@ class VIEW3D_OT_vr_camera_landmark_from_session(Operator):
loc = wm.xr_session_state.viewer_pose_location loc = wm.xr_session_state.viewer_pose_location
rot = wm.xr_session_state.viewer_pose_rotation.to_euler() rot = wm.xr_session_state.viewer_pose_rotation.to_euler()
cam = bpy.data.cameras.new("Camera_" + lm.name) cam = bpy.data.cameras.new(data_("Camera") + "_" + lm.name)
new_cam = bpy.data.objects.new("Camera_" + lm.name, cam) new_cam = bpy.data.objects.new(data_("Camera") + "_" + lm.name, cam)
scene.collection.objects.link(new_cam) scene.collection.objects.link(new_cam)
new_cam.location = loc new_cam.location = loc
new_cam.rotation_euler = rot new_cam.rotation_euler = rot
@ -215,8 +216,8 @@ class VIEW3D_OT_add_camera_from_vr_landmark(Operator):
scene = context.scene scene = context.scene
lm = properties.VRLandmark.get_selected_landmark(context) lm = properties.VRLandmark.get_selected_landmark(context)
cam = bpy.data.cameras.new("Camera_" + lm.name) cam = bpy.data.cameras.new(data_("Camera") + "_" + lm.name)
new_cam = bpy.data.objects.new("Camera_" + lm.name, cam) new_cam = bpy.data.objects.new(data_("Camera") + "_" + lm.name, cam)
scene.collection.objects.link(new_cam) scene.collection.objects.link(new_cam)
angle = lm.base_pose_angle angle = lm.base_pose_angle
new_cam.location = lm.base_pose_location new_cam.location = lm.base_pose_location