Only search projects.blender.org
Log In
New Account
Home
My Page
Projects
Blender 2.x BF release
Summary
Activity
Tracker
SCM
Files
Blender 2.6 Bug Tracker: Browse
[#26747] Crash accessing dynamic hair RNA
Date:
2011-04-03 00:33
Priority:
3
State:
Closed
Submitted by:
Matt Ebb (
broken
)
Assigned to:
Janne Karhu (jhk)
Category:
Physics
Status:
Fixed / Closed
Relates to:
Duplicates:
Patches:
Summary:
Crash accessing dynamic hair RNA
Detailed description
I've recently added support to my 3delight exporter that was added in r35721 for dynamic hair point location access in RNA. In the simplest form, it seems to be working properly, so thanks!
However, there are a few associated problems. The main thing is that when co_dynamic is accessed when 'hair dynamics' are disabled, it crashes blender. I've attached a test file though it's easy to re-create. Just open the datablocks viewer and unfold until you reach co_dynamic, like in the screenshot. If you then turn off dynamic hair it crashes blender.
I also have some comments on the implementation - even if you fix this by just disabling the rna property (or making it return 0) when hair dynamics is disabled, it's still quite ugly from an API perspective. What it means is that any time that scripters wants to access hair points, you have to add a bunch of additional logic to decide if the hair is dynamic or not, and I don't even know if there are any other conditions that may play into this too. The other issue is that if any of this internal decision-making changes, then it will break scripts since they need to decide what properties they are accessing in which context. This really shouldn't be the job of scripters who just want to get hair points.
RNA access is pretty much supposed to give you the data from blender as is the current state of the system. IMO all hair point access should just be through hairkey.co - if you access the coordinate of the hairkey it gives you what it should be. simple. I can't see any reason why you'd want to be accessing data that's not actually what you see inside blender (or render with blender internal), and other parts of RNA don't make you decide between valid and invalid data based on other conditions, it just gives you what you want. I think this hair access would be improved significantly by just keeping things simple, and giving the correct values via hairkey.co all the time.
thanks
Followup
Message
Date
: 2011-04-04 15:48
Sender
:
Janne Karhu
Making the dynamic location accessible with hairkey.co is actually a great idea, thank you for that! Changes committed in r35997. I removed the hairkey.co_dynamic and the dynamic coordinates are now in hairkey.co whenever the hair is dynamic.
Date
: 2011-04-05 00:23
Sender
:
Matt Ebb
Excellent. Thanks very much!
Attached Files:
Name
Date
Download
hairtest.blend
2011-04-03 00:33
Download
hair_rna_screen.png
2011-04-03 00:33
Download
Changes:
Field
Old Value
Date
By
status_id
Open
2011-04-04 15:48
jhk
close_date
None
2011-04-04 15:48
jhk
Status
New
2011-04-04 15:48
jhk
File Added
15706: hairtest.blend
2011-04-03 00:33
broken
File Added
15707: hair_rna_screen.png
2011-04-03 00:33
broken