Convert bConstraintTypeInfos from static array to listbase conversion #30903

Closed
opened 2012-04-11 01:29:03 +02:00 by Dan Eicher · 7 comments
Member

%%%Instead of using:

static bConstraintTypeInfo *constraintsTypeInfo[NUM_CONSTRAINT_TYPES];

use:

ListBase constraintsTypeInfoList;

with all the fun stuff that makes it work.

99.99% functionally the same, the only change is CTI_PYTHON doesn't show up in the generated EnumPropertyItem list since it's a) broken and b) will be shortly made to work again.%%%

%%%Instead of using: static bConstraintTypeInfo *constraintsTypeInfo[NUM_CONSTRAINT_TYPES]; use: ListBase constraintsTypeInfoList; with all the fun stuff that makes it work. 99.99% functionally the same, the only change is CTI_PYTHON doesn't show up in the generated EnumPropertyItem list since it's a) broken and b) will be shortly made to work again.%%%
Author
Member

Changed status to: 'Open'

Changed status to: 'Open'
Member

%%%Originally, I was almost poised to reject this, but after reading the patch, I think it could be workable with a few tweaks :)

My main concerns are:

  1. The speed hit we get as a result of using ListBase vs array AND performing a check on each item everytime we do a lookup. Admittedly, this is probably a very small value and there are far more areas of Blender which suffer from this already. But, given that bones may typically have about 3 constraints each and there being some 600-700 of these, then I'm curious if there's any speed hit for such rigs.

  2. I'm not really a fan of opening up access to the list of constraint typeinfo via the BKE_constraint header.... yet

  3. What's your plan for PyConstraints? :)%%%

%%%Originally, I was almost poised to reject this, but after reading the patch, I think it could be workable with a few tweaks :) My main concerns are: 1) The speed hit we get as a result of using ListBase vs array AND performing a check on each item everytime we do a lookup. Admittedly, this is probably a very small value and there are far more areas of Blender which suffer from this already. But, given that bones may typically have about 3 constraints each and there being some 600-700 of these, then I'm curious if there's any speed hit for such rigs. 2) I'm not really a fan of opening up access to the list of constraint typeinfo via the BKE_constraint header.... yet 3) What's your plan for PyConstraints? :)%%%

%%%why not just re-allocate the array (for py constraints)%%%

%%%why not just re-allocate the array (for py constraints)%%%
Author
Member

%%%1) The speed hit we get as a result of using ListBase vs array AND performing a check on each item everytime we do a lookup. Admittedly, this is probably a very small value and there are far more areas of Blender which suffer from this already. But, given that bones may typically have about 3 constraints each and there being some 600-700 of these, then I'm curious if there's any speed hit for such rigs.

Eh, didn't know they did that... and here I was thinking that it might be a little tricky to figure out which constraints needed to be updated if one was un/re-registered.

Probably be easiest to just realloc the array like Campbell suggested (with a little magic for changed/removed types) so the only real slowdown would be looking up non-built in types -- which would be a lot slower anyway having to go through the python interpreter.

  1. I'm not really a fan of opening up access to the list of constraint typeinfo via the BKE_constraint header.... yet

Yeah, it's pretty pointless unless you need to access it for something like making a dynamic enum of constraints for the UI or adding new types to the list.

  1. What's your plan for PyConstraints? :)

Really depends on how well this goes over...

The basic plan is just take the RenderEngine code and make it work since it pretty much solves all the difficult problems already.%%%

%%%1) The speed hit we get as a result of using ListBase vs array AND performing a check on each item everytime we do a lookup. Admittedly, this is probably a very small value and there are far more areas of Blender which suffer from this already. But, given that bones may typically have about 3 constraints each and there being some 600-700 of these, then I'm curious if there's any speed hit for such rigs. Eh, didn't know they did that... and here I was thinking that it might be a little tricky to figure out which constraints needed to be updated if one was un/re-registered. Probably be easiest to just realloc the array like Campbell suggested (with a little magic for changed/removed types) so the only real slowdown would be looking up non-built in types -- which would be a lot slower anyway having to go through the python interpreter. 2) I'm not really a fan of opening up access to the list of constraint typeinfo via the BKE_constraint header.... yet Yeah, it's pretty pointless unless you need to access it for something like making a dynamic enum of constraints for the UI or adding new types to the list. 3) What's your plan for PyConstraints? :) Really depends on how well this goes over... The basic plan is just take the RenderEngine code and make it work since it pretty much solves all the difficult problems already.%%%
Author
Member

Removed subscriber: @dna-7

Removed subscriber: @dna-7

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'

We can always apply this but seems its not really needed/important.

closing.

We can always apply this but seems its not really needed/important. closing.
Sign in to join this conversation.
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
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#30903
No description provided.