Particle HairKey[x].co gives always zero Vectors #60083
Labels
No Label
Interest
Animation & Rigging
Interest
Blender Cloud
Interest
Collada
Interest
Core
Interest
Documentation
Interest
Eevee & Viewport
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
Import and Export
Interest
Modeling
Interest
Modifiers
Interest
Nodes & Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds, Tests & Devices
Interest
Python API
Interest
Rendering & Cycles
Interest
Sculpt, Paint & Texture
Interest
Translations
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Meta
Good First Issue
Meta
Papercut
Module
Add-ons (BF-Blender)
Module
Add-ons (Community)
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
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender-addons#60083
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?
When using:
bpy.context.active_object.particle_systems.active.particles- [x].hair_keys- [x].co
It gives Vector(0,0,0) for all X and Y values, for particle hair systems.
I believe it worked in earlier blender 2.8 builds - in beginning December and before.
I attached simple bend file with particle hair system and buggy one line of code script.
HairKeyCo_Bug.blend
Added subscriber: @JoseConseco
Added subscriber: @lichtwerk
Confirmed, checking...
Added subscribers: @mont29, @Sergey, @brecht
Well from first investigation, we would need a way to flag
RNA_def_property_float_funcs
to be able to use context [FUNC_USE_CONTEXT
].This is because
rna_ParticleHairKey_location_object_get
/rna_ParticleHairKey_location_object_info
checkParticleSystemModifierData->mesh_final
which we can only get/evaluate using a depsgraph...Looks like this is not possible atm., (or needs further investigation...)
As a workaround, you can use an evaluated object on the python side of things [which gives you correct coordinates] like so
I would like to get opinions of other devs: @mont29, @brecht, @Sergey what do you think is the best way to proceed here? (I assume there are a couple of other occasions where property_float_funcs would benefit from having access to context?)
Or do we stick with the habbit of having to get the evaluated object from python first?
Thanks Philipp, depsgrapth thing work ok. It would be nice to have it working the old way, without the depsgrapth, unless it would be problem for performance.
From predictability point of view using an explicit evaluation object from a script will be preferable solution: this eliminates possibility of system silently switching to an object instance which you don't intent to. Points are:
So from this point of view i am in favor of leaving it up to script to decide what ID to access.
@brecht, @mont29: If this (what @Sergey mentioned) is the consensus, then this report can be closed?
Changed status from 'Open' to: 'Archived'
Yes, totally agree with @Sergey here. We do have a few helpers (like for raycast) where is sort of make sense to implicitly get the evaluated data from context's depsgraph, but think this should remain an exception (and a documented one).