Merge branch 'blender2.8' of git.blender.org:blender-addons into blender2.8

This commit is contained in:
Kalle-Samuli Riihikoski 2018-11-15 20:22:19 +02:00
commit fc0e32389c
10 changed files with 42 additions and 36 deletions

View File

@ -227,7 +227,7 @@ def create_materials(filepath, relpath,
# TODO: Find a way to guesstimate best value from diffuse color...
# IDEA: Use standard deviation of both spec and diff colors (i.e. how far away they are
# from some grey), and apply the the proportion between those two as tint factor?
spec = sum(spec_color) / 3.0
spec = sum(spec_colors) / 3.0
# ~ spec_var = math.sqrt(sum((c - spec) ** 2 for c in spec_color) / 3.0)
# ~ diff = sum(context_mat_wrap.base_color) / 3.0
# ~ diff_var = math.sqrt(sum((c - diff) ** 2 for c in context_mat_wrap.base_color) / 3.0)
@ -297,7 +297,8 @@ def create_materials(filepath, relpath,
col = (float_func(line_split[1]), float_func(line_split[2]), float_func(line_split[3]))
context_mat_wrap.base_color = col
elif line_id == b'ks':
spec_color = (float_func(line_split[1]) + float_func(line_split[2]) + float_func(line_split[3]))
spec_colors[:] = [
float_func(line_split[1]), float_func(line_split[2]), float_func(line_split[3])]
context_material_vars.add("specular")
elif line_id == b'ke':
# We cannot set context_material.emit right now, we need final diffuse color as well for this.

View File

@ -31,34 +31,34 @@ from bpy.props import (
########################################################################################################################
class RenderCopySettingsDataScene(bpy.types.PropertyGroup):
allowed = BoolProperty(default=True)
allowed: BoolProperty(default=True)
class RenderCopySettingsDataSetting(bpy.types.PropertyGroup):
strid = StringProperty(default="")
copy = BoolProperty(default=False)
strid: StringProperty(default="")
copy: BoolProperty(default=False)
class RenderCopySettingsData(bpy.types.PropertyGroup):
# XXX: The consistency of this collection is delegated to the UI code.
# It should only contain one element for each render setting.
affected_settings = CollectionProperty(type=RenderCopySettingsDataSetting,
name="Affected Settings",
description="The list of all available render settings")
affected_settings: CollectionProperty(type=RenderCopySettingsDataSetting,
name="Affected Settings",
description="The list of all available render settings")
# XXX Unused, but needed for template_list…
affected_settings_idx = IntProperty()
affected_settings_idx: IntProperty()
# XXX: The consistency of this collection is delegated to the UI code.
# It should only contain one element for each scene.
allowed_scenes = CollectionProperty(type=RenderCopySettingsDataScene,
name="Allowed Scenes",
description="The list all scenes in the file")
allowed_scenes: CollectionProperty(type=RenderCopySettingsDataScene,
name="Allowed Scenes",
description="The list all scenes in the file")
# XXX Unused, but needed for template_list…
allowed_scenes_idx = IntProperty()
allowed_scenes_idx: IntProperty()
filter_scene = StringProperty(name="Filter Scene",
description="Regex to only affect scenes which name matches it",
default="")
filter_scene: StringProperty(name="Filter Scene",
description="Regex to only affect scenes which name matches it",
default="")
classes = (

View File

@ -127,9 +127,9 @@ class RenderCopySettingsOPPreset(bpy.types.Operator):
# Enable undo…
bl_option = {'REGISTER', 'UNDO'}
presets = EnumProperty(items=(p.rna_enum for p in presets.presets),
default=set(),
options={'ENUM_FLAG'})
presets: EnumProperty(items=(p.rna_enum for p in presets.presets),
default=set(),
options={'ENUM_FLAG'})
@staticmethod
def process_elements(settings, elts):

View File

@ -88,8 +88,8 @@ def add_parameters(params):
""" Add the parameters of this rig type to the
RigifyParameters PropertyGroup
"""
params.make_control: bpy.props.BoolProperty(name="Control", default=True, description="Create a control bone for the copy")
params.make_deform: bpy.props.BoolProperty(name="Deform", default=True, description="Create a deform bone for the copy")
params.make_control = bpy.props.BoolProperty(name="Control", default=True, description="Create a control bone for the copy")
params.make_deform = bpy.props.BoolProperty(name="Deform", default=True, description="Create a deform bone for the copy")
def parameters_ui(layout, params):

View File

@ -127,8 +127,8 @@ def add_parameters(params):
""" Add the parameters of this rig type to the
RigifyParameters PropertyGroup
"""
params.make_controls: bpy.props.BoolProperty(name="Controls", default=True, description="Create control bones for the copy")
params.make_deforms: bpy.props.BoolProperty(name="Deform", default=True, description="Create deform bones for the copy")
params.make_controls = bpy.props.BoolProperty(name="Controls", default=True, description="Create control bones for the copy")
params.make_deforms = bpy.props.BoolProperty(name="Deform", default=True, description="Create deform bones for the copy")
def parameters_ui(layout, params):

View File

@ -91,7 +91,7 @@ def add_parameters(params):
""" Add the parameters of this rig type to the
RigifyParameters PropertyGroup
"""
params.make_control: bpy.props.BoolProperty(
params.make_control = bpy.props.BoolProperty(
name = "Control",
default = True,
description = "Create a control bone for the copy"

View File

@ -1016,26 +1016,26 @@ def add_parameters(params):
"""
#Setting up extra layers for the tweak bones
params.primary_layers_extra: bpy.props.BoolProperty(
params.primary_layers_extra = bpy.props.BoolProperty(
name = "primary_layers_extra",
default = True,
description = ""
)
params.primary_layers: bpy.props.BoolVectorProperty(
)
params.primary_layers = bpy.props.BoolVectorProperty(
size = 32,
description = "Layers for the 1st tweak controls to be on",
default = tuple( [ i == 1 for i in range(0, 32) ] )
)
params.secondary_layers_extra: bpy.props.BoolProperty(
)
params.secondary_layers_extra = bpy.props.BoolProperty(
name = "secondary_layers_extra",
default = True,
description = ""
)
params.secondary_layers: bpy.props.BoolVectorProperty(
)
params.secondary_layers = bpy.props.BoolVectorProperty(
size = 32,
description = "Layers for the 2nd tweak controls to be on",
default = tuple( [ i == 1 for i in range(0, 32) ] )
)
)
def parameters_ui(layout, params):

View File

@ -755,6 +755,7 @@ class RigUI(bpy.types.Panel):
bl_region_type = 'UI'
bl_label = "Rig Main Properties"
bl_idname = rig_id + "_PT_rig_ui"
bl_category = 'View'
@classmethod
def poll(self, context):
@ -798,6 +799,7 @@ class RigLayers(bpy.types.Panel):
bl_region_type = 'UI'
bl_label = "Rig Layers"
bl_idname = rig_id + "_PT_rig_layers"
bl_category = 'View'
@classmethod
def poll(self, context):

View File

@ -758,8 +758,10 @@ class Rig:
'DEF-chin.R' : 'lips.R',
'DEF-jaw.R.001' : 'chin.R',
'DEF-brow.T.L.003' : 'nose',
'DEF-ear.L' : None,
'DEF-ear.L.003' : 'ear.L.004',
'DEF-ear.L.004' : 'ear.L',
'DEF-ear.R' : None,
'DEF-ear.R.003' : 'ear.R.004',
'DEF-ear.R.004' : 'ear.R',
'DEF-lip.B.L.001' : 'lips.L',
@ -786,8 +788,9 @@ class Rig:
pattern = r'^DEF-(\w+\.?\w?\.?\w?)(\.?)(\d*?)(\d?)$'
for bone in [ bone for bone in all_bones['deform']['all'] if 'lid' not in bone ]:
if bone in list( def_specials.keys() ):
self.make_constraits('def_tweak', bone, def_specials[bone] )
if bone in def_specials:
if def_specials[bone] is not None:
self.make_constraits('def_tweak', bone, def_specials[bone] )
else:
matches = re.match( pattern, bone ).groups()
if len( matches ) > 1 and matches[-1]:

View File

@ -138,11 +138,11 @@ class UI_UL_i18n_languages(UIList):
def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):
if self.layout_type in {'DEFAULT', 'COMPACT'}:
layout.label(item.name, icon_value=icon)
layout.label(text=item.name, icon_value=icon)
layout.prop(item, "use", text="")
elif self.layout_type in {'GRID'}:
layout.alignment = 'CENTER'
layout.label(item.uid)
layout.label(text=item.uid)
layout.prop(item, "use", text="")