Can't generate particle hair edit 'comb cache' in blender 2.8 #64805
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
8 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#64805
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?
System Information
Operating system: Windows-10-10.0.17134 64 Bits
Graphics card: GeForce GTX 660/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 416.94
Blender Version
Broken: version: 2.80 (sub 69), branch: blender2.7, commit date: 2019-05-17 23:36, hash:
03672e7783
Worked: blender 2.79
Short description of error
Can't generate particle hair edit data with simple script that goes into particle -edimode, and generates one brush stroke (worked in 2.79):
Cache is not generate. Poll error is thrown, but same steps work if executed manually.
Exact steps for others to reproduce the error
Added subscriber: @JoseConseco
After digging bit more.
bpy.ops.particle.brush_edit() -this can generate particle edit cache ok if we are already in particle mode.
The problem is that if we are in obj mode, and in script switch to particle_edit_toggle() ('Particle') mode, then particle.brush_edit poll fails. I tried to call despgraph.update() before particle.brush_edit but it dosen't help.
Added subscribers: @Sergey, @lichtwerk
Can confirm, while polling (
PE_poll
,pe_get_current
),psys->edit
is NULLSome findings:
particle_edit_toggle_exec
):edit = PE_create_current(depsgraph, scene, ob);
PE_create_particle_edit
will also assign it to the psys:psys->edit = edit;
particle_edit_toggle_exec
and the call tobpy.ops.particle.brush_edit
(not sure if this is all relevant and not sure how much of a temporary data
psys->edit
really is, this might all work as expected and bug might be somewhere else...)@Sergey: mind checking?
Added subscriber: @fclem
@fclem, team work time!
Part of the issue is that particle system is wrongly tagged for recalc. Caused by a mistake in runtime field initialization. Can be fixed by P1002: (An Untitled Masterwork)
However, after this is fixed i've got crash in depth drawing. Seems that
DRW_draw_depth_object()
expects mesh batch cache to be already allocated. However, this is not the case here: the object is tagged for geometry update when toggling particle edit mode. I guess is is where batch cache gets removed.Operator works fine because viewport is drawn prior to stroke and that ensures all needed batch caches.
@fclem, any chances you could look into this?
Added subscriber: @Jandals
@Sergey Can you still reproduce the crash? I can't reproduce it even if I checkout the original broken commit. I did test with and without your fix but it does not change the outcome of the operator poll function.
I tried with a debug build with and without asan.
@fclem, ugh, it was relying on
36faf739a7
which caused some issues and needs re-consideration.For this specific case i think you can safely use P1018 (just don't commit it). If you can solve the crash, i can then solve the issue with unintended hair reset.
The crash is fixed.
Thanks! Will have a look into solving the unwanted hair reset.
This issue was referenced by
e4df8b005f
Just to be clear, I do not really care about hair combing error when switching from object mode - to particle edit mode. I just wish there was way to generate particle hair 'comb cache', so that later I can write hair_key.co to it. Maybe it would be easier to make new operator for generatig particle comb cache ?
Well, this is a tricky call. In this case it seems it's easy to fix this particular case, especially since it's technically regression compared to 2.79. I do have D5162 which i will commit in a bit.
Changed status from 'Open' to: 'Resolved'
Added subscriber: @shash29-dev
Hi,
Using blender 2.91 and experiencing the same problem. Is the hair reset thing fixed?
A manual brush-stroke before toggling out of particle mode still seems to be necessary to keep the updated hair structure through a python script.
If done without the stroke, the hair structure is lost.
Is possible that the issue got re-introduced, as the particle system is a very fragile area.
Can you reproduce the issue with the steps and file from this report?
usc_head_vtxgp.blend
system-info.txt
alpha_test.py
strands00001.txt
Adding necessary files to reproduce the error. In the .py file's last line, toggling out of particle mode does the hair reset. If 102 line is commented, the hair structure is preserved but no cache is generated until a manual stroke is done.
Running the alpha_test.py with all other attached files in the working directory reproduces the issue.
I just tested original script from first post and it works ok (except api change for bpy.ops.particle.brush_edit , but cache is generated correctly)
I don't know what I am doing wrong. From the original script also, I keep on getting poll errors on brush_edit.
Is the hair reset issue is generated in the attached example (alpha_test) by running:
Please verify
If the initial report works fine, please submit a new bug report.
Added subscriber: @sydianchen
@Sergey Hi, I tested script of first post in Blender 3.1 and it raised one poll error as well. Is there any chance this error could be fixed again? I simply just want to find a way to write hairkey.co.
Anyway, I solved this comb cache problem by adjusting hair using this line of code:
Now I can change
co
as I wanted.