WIP: Subtype for input function nodes #107010
No reviewers
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
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#107010
Loading…
Reference in New Issue
No description provided.
Delete Branch "Weikang-Qiu/blender:node-subtype"
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?
Problem
This patch is related to the issue #106505.
Solution
This is a rough patch where I only implement the subtype list for the function input vector node. Currently the subtype list includes all subtypes listed on https://docs.blender.org/api/current/bpy_types_enum_items/property_subtype_number_array_items.html#rna-enum-property-subtype-number-array-items. This is achieved by adding a
subtype
value in the node storage structure, and duplicating multiple properties associated with the samevector
value.demo-input-vector-subtype.mp4
Limitations
These properties will be all visible to python.
The subtypes have the same display name, for example, both
COLOR
andCOLOR_GAMMA
will display "Color". Also, some subtypes likeAXISANGLE
are 4d vector, but originally the node only supports 3d vector.28c1aa3446
to393269266d
Solution changed
Instead of duplicating multiple properties associated with the same data:
Add a callback function to
ntype.updatefunc
. Add some utilities functions inRNA_access.h
(not sure if these functions should be there or somewhere else, but since it is just a demo, I just put them there for now).4e0e0e0662
to384d734534
@ -5251,0 +5255,4 @@
{
PointerRNA ptr;
RNA_pointer_create(id, &RNA_Node, data, &ptr);
This is not very practical, because in fact, it cannot be applied to the properties of an object, for example? Is it possible to make property references without statically specifying the structure type? It seems one of the
node_layout
arguments might be useful. That is, it seems that the update function should do this itself and pass inRNA_property_subtype_set
prop
as argument?Update Summary
move the
RNA_pointer_create(id, &RNA_Node, data, &ptr);
out of theRNA_property_subtype_set
to make it more general.Add a
rna_Node_update_individual
function to only change the node (prevent from propagating).Checkout
From your project repository, check out a new branch and test the changes.