Operating system: Windows-10-10.0.17763 64 Bits
Graphics card: GeForce GTX 1060/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 388.73
Broken: version: 2.80 (sub 74), branch: blender2.7, commit date: 2019-06-04 00:52, hash: rBc13e10a7404d
Worked: version 2.79, any build.
Short description of error
The python bindings to edit hair particle data don't appear to be working in blender 2.8. The same bindings work perfectly in blender 2.79 builds.
CONTEXT: We have been using this hair particle data editing mechanism in blender 2.79 to load Alembic hair curves and convert them to Cycles hair rendering primitives. Importing the curves in Blender creates Bezier curves which need to be tessellated in order to render in Cycles. If there is another mechanism to import Alembic curves directly into Blender as Cycles hair primitives, please let me know.
Exact steps for others to reproduce the error
- Load "hair_python_280.blend". In the Python console,
bpy.ops.particle.particle_edit_toggle() dg = bpy.context.evaluated_depsgraph_get() hair = dg.objects["hair_emitter"].particle_systems["hair"] hair.particles.hair_keys.co = Vector((5, 5, 5)) bpy.ops.particle.particle_edit_toggle()
Note that I'm trying to use the new depsgraph through "evaluated_depsgraph_get()". It's interesting to see that the particle position snaps back as soon as the last bpy.ops.particle.particle_edit_toggle() is called. I suspect a python binding needs to be exposed to trigger the same scene graph update which occurs after a brush edit.
- For reference, using the following lines in blender 2.79 works. I'm including a file where you can try it "hair_python_279.blend".
bpy.ops.particle.particle_edit_toggle() hair = bpy.data.objects["hair_emitter"].particle_systems["hair"] hair.particles.hair_keys.co = Vector((5, 5, 5)) bpy.ops.particle.particle_edit_toggle()