Dynamic PropertyGroup classes no longer possible in 2.93 #86719
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
9 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#86719
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
System Information
Operating system: *
Graphics card: *
Blender Version
Broken: Blender 2.93 (after https://developer.blender.org/rBc44c611c6d8c6ae071b48efb5fc07168f18cd17e)
Worked: (newest version of Blender that worked as expected)
Short description of error
This is somewhat rare, but IMO perfectly valid Python use case of dynamically creating a new class and then wanting to register it. That is, we want to dynamically subtype a PropertyGroup class, add some properties to it, and then register the class
One example of "why", is for example MaterialX gives us a whole bunch of shader node types specified in xml files that we would like to create custom node types from, so we write a small script to parse the XML and create node classes on the fly.
Exact steps for others to reproduce the error
also attached a blend file with the above script. In 2.93 does not seem like it registers the int property.example.blend. I'm tagging @ideasman42 in this because it seems related to the DeferredProperty when we inspect deeper. If there is another way to achieve creating the properties for these dynamic types let me know.
Added subscribers: @ideasman42, @BrianSavery
Added subscriber: @bnagirniak
Added subscriber: @PhilippeCrassous
Added subscriber: @AquaticNightmare
Added subscriber: @karlisup
Added subscriber: @JoshuaKnauber
Added subscriber: @RayMairlot
Added subscriber: @lichtwerk
Changed status from 'Needs Triage' to: 'Confirmed'
Looks like a valid usecase, but not sure how to classify.
Will confirm for now though and even dare setting this to High priority -- since I would not be aware of a way around this "new limitation/regression" for now.
Changed status from 'Confirmed' to: 'Archived'
Creating classes dynamically is still supported. The example given relied on an internal representation of properties which was never documented or intended for script authors to depend on.
This works as expected:
Ah, good to know, thx @ideasman42
This example is working, thanks!