Fix #141948: No error on arbitrary assignments to PropertyGroup
Declare `__slots__` to prevent arbitrary assignment.
This commit is contained in:
@@ -374,6 +374,7 @@ def update_pause(self, context):
|
||||
|
||||
|
||||
class CyclesRenderSettings(bpy.types.PropertyGroup):
|
||||
__slots__ = ()
|
||||
|
||||
device: EnumProperty(
|
||||
name="Device",
|
||||
@@ -1111,6 +1112,7 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
|
||||
|
||||
|
||||
class CyclesCustomCameraSettings(bpy.types.PropertyGroup):
|
||||
__slots__ = ()
|
||||
|
||||
@classmethod
|
||||
def register(cls):
|
||||
@@ -1126,6 +1128,7 @@ class CyclesCustomCameraSettings(bpy.types.PropertyGroup):
|
||||
|
||||
|
||||
class CyclesMaterialSettings(bpy.types.PropertyGroup):
|
||||
__slots__ = ()
|
||||
|
||||
emission_sampling: EnumProperty(
|
||||
name="Emission Sampling",
|
||||
@@ -1182,6 +1185,7 @@ class CyclesMaterialSettings(bpy.types.PropertyGroup):
|
||||
|
||||
|
||||
class CyclesLightSettings(bpy.types.PropertyGroup):
|
||||
__slots__ = ()
|
||||
|
||||
max_bounces: IntProperty(
|
||||
name="Max Bounces",
|
||||
@@ -1222,6 +1226,7 @@ class CyclesLightSettings(bpy.types.PropertyGroup):
|
||||
|
||||
|
||||
class CyclesWorldSettings(bpy.types.PropertyGroup):
|
||||
__slots__ = ()
|
||||
|
||||
is_caustics_light: BoolProperty(
|
||||
name="Shadow Caustics",
|
||||
@@ -1288,6 +1293,7 @@ class CyclesWorldSettings(bpy.types.PropertyGroup):
|
||||
|
||||
|
||||
class CyclesVisibilitySettings(bpy.types.PropertyGroup):
|
||||
__slots__ = ()
|
||||
|
||||
camera: BoolProperty(
|
||||
name="Camera",
|
||||
@@ -1340,6 +1346,8 @@ class CyclesVisibilitySettings(bpy.types.PropertyGroup):
|
||||
|
||||
|
||||
class CyclesMeshSettings(bpy.types.PropertyGroup):
|
||||
__slots__ = ()
|
||||
|
||||
@classmethod
|
||||
def register(cls):
|
||||
bpy.types.Mesh.cycles = PointerProperty(
|
||||
@@ -1366,6 +1374,7 @@ class CyclesMeshSettings(bpy.types.PropertyGroup):
|
||||
|
||||
|
||||
class CyclesObjectSettings(bpy.types.PropertyGroup):
|
||||
__slots__ = ()
|
||||
|
||||
use_motion_blur: BoolProperty(
|
||||
name="Use Motion Blur",
|
||||
@@ -1464,6 +1473,7 @@ class CyclesObjectSettings(bpy.types.PropertyGroup):
|
||||
|
||||
|
||||
class CyclesCurveRenderSettings(bpy.types.PropertyGroup):
|
||||
__slots__ = ()
|
||||
|
||||
shape: EnumProperty(
|
||||
name="Shape",
|
||||
@@ -1492,6 +1502,7 @@ class CyclesCurveRenderSettings(bpy.types.PropertyGroup):
|
||||
|
||||
|
||||
class CyclesRenderLayerSettings(bpy.types.PropertyGroup):
|
||||
__slots__ = ()
|
||||
|
||||
pass_debug_sample_count: BoolProperty(
|
||||
name="Debug Sample Count",
|
||||
@@ -1546,6 +1557,8 @@ class CyclesRenderLayerSettings(bpy.types.PropertyGroup):
|
||||
|
||||
|
||||
class CyclesDeviceSettings(bpy.types.PropertyGroup):
|
||||
__slots__ = ()
|
||||
|
||||
id: StringProperty(name="ID")
|
||||
name: StringProperty(name="Name")
|
||||
use: BoolProperty(name="Use", default=True)
|
||||
@@ -1929,6 +1942,8 @@ class CyclesPreferences(bpy.types.AddonPreferences):
|
||||
|
||||
|
||||
class CyclesView3DShadingSettings(bpy.types.PropertyGroup):
|
||||
__slots__ = ()
|
||||
|
||||
render_pass: EnumProperty(
|
||||
name="Render Pass",
|
||||
description="Render pass to show in the 3D Viewport",
|
||||
|
||||
@@ -673,8 +673,7 @@ def cli_extension(argv):
|
||||
|
||||
|
||||
class BlExtDummyGroup(bpy.types.PropertyGroup):
|
||||
# Dummy.
|
||||
pass
|
||||
__slots__ = ()
|
||||
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
@@ -2113,6 +2113,8 @@ def import_panel_user_extension(context, layout):
|
||||
|
||||
|
||||
class GLTF2_filter_action(bpy.types.PropertyGroup):
|
||||
__slots__ = ()
|
||||
|
||||
keep: bpy.props.BoolProperty(name="Keep Animation")
|
||||
action: bpy.props.PointerProperty(type=bpy.types.Action)
|
||||
|
||||
|
||||
@@ -25,10 +25,14 @@ from bpy.props import (
|
||||
|
||||
|
||||
class SelectionEntry(PropertyGroup):
|
||||
__slots__ = ()
|
||||
|
||||
name: StringProperty(name="Bone Name", override={'LIBRARY_OVERRIDABLE'})
|
||||
|
||||
|
||||
class SelectionSet(PropertyGroup):
|
||||
__slots__ = ()
|
||||
|
||||
name: StringProperty(name="Set Name", override={'LIBRARY_OVERRIDABLE'})
|
||||
bone_ids: CollectionProperty(
|
||||
type=SelectionEntry,
|
||||
|
||||
@@ -29,6 +29,8 @@ from bpy.app.translations import (
|
||||
|
||||
|
||||
class NodeSetting(PropertyGroup):
|
||||
__slots__ = ()
|
||||
|
||||
value: StringProperty(
|
||||
name="Value",
|
||||
description="Python expression to be evaluated "
|
||||
|
||||
@@ -2665,6 +2665,8 @@ class WM_OT_toolbar_prompt(Operator):
|
||||
|
||||
|
||||
class BatchRenameAction(bpy.types.PropertyGroup):
|
||||
__slots__ = ()
|
||||
|
||||
# category: StringProperty()
|
||||
type: EnumProperty(
|
||||
name="Operation",
|
||||
|
||||
Reference in New Issue
Block a user