Merge branch 'blender-v4.3-release'
This commit is contained in:
commit
b3919319fb
@ -37,10 +37,12 @@ class ShaderScriptImport(bpy.types.Operator, ImportHelper):
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
return (context.region and context.region.type == 'WINDOW'
|
||||
and context.area and context.area.ui_type == 'ShaderNodeTree'
|
||||
and context.object and context.object.type == 'MESH'
|
||||
and context.material)
|
||||
return (
|
||||
context.region and context.region.type == 'WINDOW' and
|
||||
context.area and context.area.ui_type == 'ShaderNodeTree' and
|
||||
context.object and context.object.type == 'MESH' and
|
||||
context.material
|
||||
)
|
||||
|
||||
def execute(self, context):
|
||||
""" The directory property need to be set. """
|
||||
@ -91,8 +93,10 @@ class SHADER_FH_script_import(bpy.types.FileHandler):
|
||||
|
||||
@classmethod
|
||||
def poll_drop(cls, context):
|
||||
return (context.region and context.region.type == 'WINDOW'
|
||||
and context.area and context.area.ui_type == 'ShaderNodeTree')
|
||||
return (
|
||||
context.region and context.region.type == 'WINDOW' and
|
||||
context.area and context.area.ui_type == 'ShaderNodeTree'
|
||||
)
|
||||
|
||||
|
||||
bpy.utils.register_class(ShaderScriptImport)
|
||||
|
@ -72,9 +72,11 @@ class CyclesDebugButtonsPanel(CyclesButtonsPanel):
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
prefs = bpy.context.preferences
|
||||
return (CyclesButtonsPanel.poll(context)
|
||||
and prefs.experimental.use_cycles_debug
|
||||
and prefs.view.show_developer_ui)
|
||||
return (
|
||||
CyclesButtonsPanel.poll(context) and
|
||||
prefs.experimental.use_cycles_debug and
|
||||
prefs.view.show_developer_ui
|
||||
)
|
||||
|
||||
|
||||
# Adapt properties editor panel to display in node editor. We have to
|
||||
|
@ -227,9 +227,11 @@ class NODE_OT_connect_to_output(Operator, NodeEditorBase):
|
||||
|
||||
# Go up in the node group hierarchy.
|
||||
next_tree = path[path_index + 1].node_tree
|
||||
node = next(n for n in next_tree.nodes
|
||||
if n.type == 'GROUP'
|
||||
and n.node_tree == tree)
|
||||
node = next(
|
||||
n for n in next_tree.nodes
|
||||
if n.type == 'GROUP' and
|
||||
n.node_tree == tree
|
||||
)
|
||||
tree = next_tree
|
||||
active_node_socket_id = viewer_socket.identifier
|
||||
return node.outputs[active_node_socket_id]
|
||||
|
@ -63,10 +63,10 @@ class ViewLayerFreestyleButtonsPanel:
|
||||
with_freestyle = bpy.app.build_options.freestyle
|
||||
|
||||
return (
|
||||
scene
|
||||
and with_freestyle
|
||||
and rd.use_freestyle
|
||||
and (context.engine in cls.COMPAT_ENGINES)
|
||||
scene and
|
||||
with_freestyle and
|
||||
rd.use_freestyle and
|
||||
(context.engine in cls.COMPAT_ENGINES)
|
||||
)
|
||||
|
||||
|
||||
@ -79,9 +79,9 @@ class ViewLayerFreestyleEditorButtonsPanel(ViewLayerFreestyleButtonsPanel):
|
||||
return False
|
||||
view_layer = context.view_layer
|
||||
return (
|
||||
view_layer
|
||||
and view_layer.use_freestyle
|
||||
and view_layer.freestyle_settings.mode == 'EDITOR'
|
||||
view_layer and
|
||||
view_layer.use_freestyle and
|
||||
view_layer.freestyle_settings.mode == 'EDITOR'
|
||||
)
|
||||
|
||||
|
||||
@ -1284,11 +1284,11 @@ class MaterialFreestyleButtonsPanel:
|
||||
material = context.material
|
||||
with_freestyle = bpy.app.build_options.freestyle
|
||||
return (
|
||||
with_freestyle
|
||||
and material
|
||||
and scene
|
||||
and scene.render.use_freestyle
|
||||
and (context.engine in cls.COMPAT_ENGINES)
|
||||
with_freestyle and
|
||||
material and
|
||||
scene and
|
||||
scene.render.use_freestyle and
|
||||
(context.engine in cls.COMPAT_ENGINES)
|
||||
)
|
||||
|
||||
|
||||
|
@ -805,9 +805,11 @@ class PHYSICS_PT_dp_brush_source_color_ramp(PhysicButtonsPanel, Panel):
|
||||
return False
|
||||
|
||||
brush = context.dynamic_paint.brush_settings
|
||||
return ((brush.paint_source in {'DISTANCE', 'VOLUME_DISTANCE', 'POINT'})
|
||||
and (brush.proximity_falloff == 'RAMP')
|
||||
and (context.engine in cls.COMPAT_ENGINES))
|
||||
return (
|
||||
(brush.paint_source in {'DISTANCE', 'VOLUME_DISTANCE', 'POINT'}) and
|
||||
(brush.proximity_falloff == 'RAMP') and
|
||||
(context.engine in cls.COMPAT_ENGINES)
|
||||
)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
@ -260,8 +260,10 @@ class PHYSICS_PT_rigid_body_dynamics(PHYSICS_PT_rigidbody_panel, Panel):
|
||||
obj = context.object
|
||||
if obj.parent is not None and obj.parent.rigid_body is not None:
|
||||
return False
|
||||
return (obj and obj.rigid_body and obj.rigid_body.type == 'ACTIVE'
|
||||
and (context.engine in cls.COMPAT_ENGINES))
|
||||
return (
|
||||
obj and obj.rigid_body and obj.rigid_body.type == 'ACTIVE' and
|
||||
(context.engine in cls.COMPAT_ENGINES)
|
||||
)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
@ -295,9 +297,11 @@ class PHYSICS_PT_rigid_body_dynamics_deactivation(PHYSICS_PT_rigidbody_panel, Pa
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
obj = context.object
|
||||
return (obj and obj.rigid_body
|
||||
and obj.rigid_body.type == 'ACTIVE'
|
||||
and (context.engine in cls.COMPAT_ENGINES))
|
||||
return (
|
||||
obj and obj.rigid_body and
|
||||
obj.rigid_body.type == 'ACTIVE' and
|
||||
(context.engine in cls.COMPAT_ENGINES)
|
||||
)
|
||||
|
||||
def draw_header(self, context):
|
||||
ob = context.object
|
||||
|
@ -140,8 +140,10 @@ class PHYSICS_PT_rigid_body_constraint_limits(PHYSICS_PT_rigidbody_constraint_pa
|
||||
ob = context.object
|
||||
rbc = ob.rigid_body_constraint
|
||||
|
||||
return (ob and rbc and (rbc.type in {'GENERIC', 'GENERIC_SPRING', 'HINGE', 'SLIDER', 'PISTON'})
|
||||
and context.engine in cls.COMPAT_ENGINES)
|
||||
return (
|
||||
ob and rbc and (rbc.type in {'GENERIC', 'GENERIC_SPRING', 'HINGE', 'SLIDER', 'PISTON'}) and
|
||||
context.engine in cls.COMPAT_ENGINES
|
||||
)
|
||||
|
||||
def draw(self, _context):
|
||||
return # do nothing.
|
||||
@ -161,9 +163,11 @@ class PHYSICS_PT_rigid_body_constraint_limits_linear(PHYSICS_PT_rigidbody_constr
|
||||
ob = context.object
|
||||
rbc = ob.rigid_body_constraint
|
||||
|
||||
return (ob and rbc
|
||||
and (rbc.type in {'GENERIC', 'GENERIC_SPRING', 'SLIDER', 'PISTON'})
|
||||
and context.engine in cls.COMPAT_ENGINES)
|
||||
return (
|
||||
ob and rbc and
|
||||
(rbc.type in {'GENERIC', 'GENERIC_SPRING', 'SLIDER', 'PISTON'}) and
|
||||
context.engine in cls.COMPAT_ENGINES
|
||||
)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
@ -222,9 +226,11 @@ class PHYSICS_PT_rigid_body_constraint_limits_angular(PHYSICS_PT_rigidbody_const
|
||||
ob = context.object
|
||||
rbc = ob.rigid_body_constraint
|
||||
|
||||
return (ob and rbc
|
||||
and (rbc.type in {'GENERIC', 'GENERIC_SPRING', 'HINGE', 'PISTON'})
|
||||
and context.engine in cls.COMPAT_ENGINES)
|
||||
return (
|
||||
ob and rbc and
|
||||
(rbc.type in {'GENERIC', 'GENERIC_SPRING', 'HINGE', 'PISTON'}) and
|
||||
context.engine in cls.COMPAT_ENGINES
|
||||
)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
@ -292,8 +298,10 @@ class PHYSICS_PT_rigid_body_constraint_motor(PHYSICS_PT_rigidbody_constraint_pan
|
||||
ob = context.object
|
||||
rbc = ob.rigid_body_constraint
|
||||
|
||||
return (ob and rbc and rbc.type == 'MOTOR'
|
||||
and context.engine in cls.COMPAT_ENGINES)
|
||||
return (
|
||||
ob and rbc and rbc.type == 'MOTOR' and
|
||||
context.engine in cls.COMPAT_ENGINES
|
||||
)
|
||||
|
||||
def draw(self, _context):
|
||||
return # do nothing.
|
||||
@ -313,8 +321,12 @@ class PHYSICS_PT_rigid_body_constraint_motor_angular(PHYSICS_PT_rigidbody_constr
|
||||
ob = context.object
|
||||
rbc = ob.rigid_body_constraint
|
||||
|
||||
return (ob and rbc and rbc.type == 'MOTOR'
|
||||
and context.engine in cls.COMPAT_ENGINES)
|
||||
return (
|
||||
ob and
|
||||
rbc and
|
||||
rbc.type == 'MOTOR' and
|
||||
context.engine in cls.COMPAT_ENGINES
|
||||
)
|
||||
|
||||
def draw_header(self, context):
|
||||
ob = context.object
|
||||
@ -353,8 +365,10 @@ class PHYSICS_PT_rigid_body_constraint_motor_linear(PHYSICS_PT_rigidbody_constra
|
||||
ob = context.object
|
||||
rbc = ob.rigid_body_constraint
|
||||
|
||||
return (ob and rbc and rbc.type == 'MOTOR'
|
||||
and context.engine in cls.COMPAT_ENGINES)
|
||||
return (
|
||||
ob and rbc and rbc.type == 'MOTOR' and
|
||||
context.engine in cls.COMPAT_ENGINES
|
||||
)
|
||||
|
||||
def draw_header(self, context):
|
||||
ob = context.object
|
||||
@ -393,9 +407,11 @@ class PHYSICS_PT_rigid_body_constraint_springs(PHYSICS_PT_rigidbody_constraint_p
|
||||
ob = context.object
|
||||
rbc = ob.rigid_body_constraint
|
||||
|
||||
return (ob and ob.rigid_body_constraint
|
||||
and rbc.type == 'GENERIC_SPRING'
|
||||
and context.engine in cls.COMPAT_ENGINES)
|
||||
return (
|
||||
ob and ob.rigid_body_constraint and
|
||||
rbc.type == 'GENERIC_SPRING' and
|
||||
context.engine in cls.COMPAT_ENGINES
|
||||
)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
@ -421,9 +437,11 @@ class PHYSICS_PT_rigid_body_constraint_springs_angular(PHYSICS_PT_rigidbody_cons
|
||||
ob = context.object
|
||||
rbc = ob.rigid_body_constraint
|
||||
|
||||
return (ob and ob.rigid_body_constraint
|
||||
and rbc.type == 'GENERIC_SPRING'
|
||||
and context.engine in cls.COMPAT_ENGINES)
|
||||
return (
|
||||
ob and ob.rigid_body_constraint and
|
||||
rbc.type == 'GENERIC_SPRING' and
|
||||
context.engine in cls.COMPAT_ENGINES
|
||||
)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
@ -473,9 +491,11 @@ class PHYSICS_PT_rigid_body_constraint_springs_linear(PHYSICS_PT_rigidbody_const
|
||||
ob = context.object
|
||||
rbc = ob.rigid_body_constraint
|
||||
|
||||
return (ob and ob.rigid_body_constraint
|
||||
and rbc.type == 'GENERIC_SPRING'
|
||||
and context.engine in cls.COMPAT_ENGINES)
|
||||
return (
|
||||
ob and ob.rigid_body_constraint and
|
||||
rbc.type == 'GENERIC_SPRING' and
|
||||
context.engine in cls.COMPAT_ENGINES
|
||||
)
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
@ -103,9 +103,11 @@ class CurvesTest(ABC):
|
||||
if len(attribute.data.items()) != len(expected_attribute.data.items()):
|
||||
print("Attribute data length doesn't match")
|
||||
|
||||
value_attr_name = ('vector' if attribute.data_type == 'FLOAT_VECTOR'
|
||||
or attribute.data_type == 'FLOAT2' else
|
||||
'color' if attribute.data_type == 'FLOAT_COLOR' else 'value')
|
||||
value_attr_name = (
|
||||
'vector' if attribute.data_type == 'FLOAT_VECTOR' or
|
||||
attribute.data_type == 'FLOAT2' else
|
||||
'color' if attribute.data_type == 'FLOAT_COLOR' else 'value'
|
||||
)
|
||||
|
||||
for v_idx, attribute_value in attribute.data.items():
|
||||
if getattr(
|
||||
|
Loading…
x
Reference in New Issue
Block a user