Can't dynamically set particle birth time any more #43471

Closed
opened 2015-01-29 12:06:33 +01:00 by Alex Fraser · 22 comments
Member

System Information
Ubuntu 14.10, Intel i5 and i7, nVidia and ATI cards

Blender Version
Broken: 2.70a f93bc76 Backport revisions for the 2.70a release
Broken: 78c491e Fix #35247: Particle texture behaves incorrectly after changing the number of particles
Worked: 9800ed5 Code cleanup: replace magic constants with more verbose bitnames
Worked: 2.69 r60991 1b6b47c

It seems that the bug was introduced in 78c491e.

Short description of error
Previously, it was possible to use Python to change the birth_time of a particle during an animation. This allowed full control over where and when the particles would spawn. But now it fails: particles kind of insist on being born at the natural time, and the locations and velocities are wrong.

Exact steps for others to reproduce the error

  1. Load attached particle_birth_test.blend
  2. Play the animation. The emitter should move left-to-right, emitting particles at a constant rate, like this:
  {F139799}
  1. Reload the file.
  2. Run the smash script. The script uses a frame_change_pre callback to detect collisions and cause particles to be born.
  3. Play the animation. The emitter should move left-to-right, emitting particles in bursts as it collides with the planes, like this:
  {F139798}
  But actually, it does something like this in 2.70a:
  {F139797}
  Let it play through a few times to see the full behaviour, including interaction with the point cache.
**System Information** Ubuntu 14.10, Intel i5 and i7, nVidia and ATI cards **Blender Version** Broken: 2.70a f93bc76 Backport revisions for the 2.70a release Broken: 78c491e Fix #35247: Particle texture behaves incorrectly after changing the number of particles Worked: 9800ed5 Code cleanup: replace magic constants with more verbose bitnames Worked: 2.69 r60991 1b6b47c It seems that the bug was introduced in 78c491e. **Short description of error** Previously, it was possible to use Python to change the `birth_time` of a particle during an animation. This allowed full control over where and when the particles would spawn. But now it fails: particles kind of insist on being born at the natural time, and the locations and velocities are wrong. **Exact steps for others to reproduce the error** 1. Load attached [particle_birth_test.blend](https://archive.blender.org/developer/F139803/particle_birth_test.blend) 1. Play the animation. The emitter should move left-to-right, emitting particles at a constant rate, like this: ``` {F139799} ``` 1. Reload the file. 1. Run the `smash` script. The script uses a `frame_change_pre` callback to detect collisions and cause particles to be born. 1. Play the animation. The emitter should move left-to-right, emitting particles in bursts as it collides with the planes, like this: ``` {F139798} But actually, it does something like this in 2.70a: {F139797} Let it play through a few times to see the full behaviour, including interaction with the point cache.
Author
Member

Changed status to: 'Open'

Changed status to: 'Open'
Author
Member

Added subscriber: @z0r

Added subscriber: @z0r

Added subscribers: @LukasTonne, @Sergey, @Psy-Fi

Added subscribers: @LukasTonne, @Sergey, @Psy-Fi

Can @LukasTonne or @Sergey check things here?

Can @LukasTonne or @Sergey check things here?
Lukas Tönne was assigned by Antonis Ryakiotakis 2015-01-29 15:29:14 +01:00

Added subscriber: @adfries

Added subscriber: @adfries

Added subscriber: @zeauro

Added subscriber: @zeauro
Member

I would say this is simply not supported. Particles are totally limited in this regard, if it worked before with scripting it must be considered a lucky accident ...

I would say this is simply not supported. Particles are totally limited in this regard, if it worked before with scripting it must be considered a lucky accident ...
Member

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Author
Member

Thanks for reviewing my report.

This is a feature that I would really miss if it was gone for good. My colleagues and I built a significant add-on for a client that depends on this behaviour, and removing it would mean we have to tell them that we can't support them any more.

If we develop a patch that doesn't break #35247, might you accept it?

Thanks for reviewing my report. This is a feature that I would really miss if it was gone for good. My colleagues and I built a significant add-on for a client that depends on this behaviour, and removing it would mean we have to tell them that we can't support them any more. If we develop a patch that doesn't break #35247, might you accept it?
Member

Certainly. Sorry if closing this was a bit harsh, i'm just really frustrated with particles and generally consider them broken. If we can keep them working for a little bit longer that would be great of course, any help is appreciated!

Certainly. Sorry if closing this was a bit harsh, i'm just really frustrated with particles and generally consider them broken. If we can keep them working for a little bit longer that would be great of course, any help is appreciated!

Added subscriber: @sean_loh

Added subscriber: @sean_loh

Hi guys,

I'm Sean, I'm doing some work with Alex on his Blender project at the moment.

I've attached a patch that fixes the issue we were having after the changes made in #35247. It basically just stops the code calling initialize_particle_textures() if there are no particle textures. I found that after Alex's Python script had manually changed the particle birth_time, this function was re-setting the birth_time from data in ParticleSettings.

I've tested the patch with Alex's test file and the one from #35247 and they both run fine, have a look though and let me know if there is anything I have overlooked.

Cheers

Sean

fix_for_T43471.patch

Hi guys, I'm Sean, I'm doing some work with Alex on his Blender project at the moment. I've attached a patch that fixes the issue we were having after the changes made in #35247. It basically just stops the code calling initialize_particle_textures() if there are no particle textures. I found that after Alex's Python script had manually changed the particle birth_time, this function was re-setting the birth_time from data in ParticleSettings. I've tested the patch with Alex's test file and the one from #35247 and they both run fine, have a look though and let me know if there is anything I have overlooked. Cheers Sean [fix_for_T43471.patch](https://archive.blender.org/developer/F142609/fix_for_T43471.patch)

This issue was referenced by b2b54b0902

This issue was referenced by b2b54b0902045ec4f0c1a4cae3209be863878f5b
Member

Changed status from 'Archived' to: 'Resolved'

Changed status from 'Archived' to: 'Resolved'
Member

Closed by commit b2b54b0902.

Closed by commit b2b54b0902.
Member

Thanks for the patch! I've committed a slightly modified version, which should fix the issue for now.

Thanks for the patch! I've committed a slightly modified version, which should fix the issue for now.

This issue was referenced by db297e7ea3

This issue was referenced by db297e7ea314ee1e0f6db796c3dfc6683f64cd22
Member

Sorry, but the patch breaks basic particle distribution. Unless we find a proper fix for this issue you will have to stick to an old Blender version or a custom build.

Sorry, but the patch breaks basic particle distribution. Unless we find a proper fix for this issue you will have to stick to an old Blender version or a custom build.

Thanks Lukas, could you clarify what went wrong with the basic particle distribution? I tested the patch you committed and didn't see anything obviously wrong. The test case I used was just a Newtonian particle system added to the initial cube object (attached). The original test cases also appeared to run fine.cube.blend

Thanks Lukas, could you clarify what went wrong with the basic particle distribution? I tested the patch you committed and didn't see anything obviously wrong. The test case I used was just a Newtonian particle system added to the initial cube object (attached). The original test cases also appeared to run fine.[cube.blend](https://archive.blender.org/developer/F144032/cube.blend)

@sean_loh, revert Lukas's patch, then with default cube:

  • Go to particle systems
  • Add new particle system
  • Switch emitter to Hair

This would distribute hairs only on top and bottom faces, and some distribution will happen on one of the side faces. It should be even distribution of same length hair on all the faces.

@sean_loh, revert Lukas's patch, then with default cube: - Go to particle systems - Add new particle system - Switch emitter to Hair This would distribute hairs only on top and bottom faces, and some distribution will happen on one of the side faces. It should be even distribution of same length hair on all the faces.

Ah yes I see what you mean, how about this then?

I've moved the if (has_texture) statement so it only applies to the PART_EMITTER case so hair should work exactly as it did before.

fix_for_T43471_1.patch

Ah yes I see what you mean, how about this then? I've moved the `if (has_texture)` statement so it only applies to the `PART_EMITTER` case so hair should work exactly as it did before. [fix_for_T43471_1.patch](https://archive.blender.org/developer/F144360/fix_for_T43471_1.patch)

Hi guys, any thoughts on this? We would really like to have this working again.

Cheers,
Alex

Hi guys, any thoughts on this? We would really like to have this working again. Cheers, Alex
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
8 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#43471
No description provided.