Hiding/unhiding NLA strip doesn't update the 3D viewport [PATCH INCLUDED] #42697

Closed
opened 2014-11-23 12:02:17 +01:00 by inactive account · 16 comments

System Information
Ubuntu Linux 14.10, GeForce GTX 970

Blender Version
Broken: 2.72b, also tested on b9d9df9810

Short description of error
Hiding or unhiding an NLA strip doesn't update the 3D viewport.

Exact steps for others to reproduce the error

  1. Open the attached blend file nla_aligning.blend
  2. Place mouse cursor in the NLA editor
  3. Press [H]
  4. See that the armature in the 3D view doesn't change position.
  5. Move the scene one frame forward and back again to update the 3D viewport.
  6. See that the armature is now in a different position than in step 4.

The attached patch 0002-NLA-Fix-Hiding-unhiding-NLA-strip-doesn-t-update-the.patch sends a notification that the scene has been updated, fixing this issue.

**System Information** Ubuntu Linux 14.10, GeForce GTX 970 **Blender Version** Broken: 2.72b, also tested on b9d9df9810c6b66584b36186876e9da08709c84a **Short description of error** Hiding or unhiding an NLA strip doesn't update the 3D viewport. **Exact steps for others to reproduce the error** 1. Open the attached blend file [nla_aligning.blend](https://archive.blender.org/developer/F125517/nla_aligning.blend) 2. Place mouse cursor in the NLA editor 3. Press [H] 4. See that the armature in the 3D view doesn't change position. 5. Move the scene one frame forward and back again to update the 3D viewport. 6. See that the armature is now in a different position than in step 4. The attached patch [0002-NLA-Fix-Hiding-unhiding-NLA-strip-doesn-t-update-the.patch](https://archive.blender.org/developer/F125518/0002-NLA-Fix-Hiding-unhiding-NLA-strip-doesn-t-update-the.patch) sends a notification that the scene has been updated, fixing this issue.

Changed status to: 'Open'

Changed status to: 'Open'

Added subscriber: @sybrenstuvel

Added subscriber: @sybrenstuvel

PS: Another way to solve this would be to let the 3D viewport listen to the NC_ANIMATION | ND_NLA | NA_EDITED notifications that are already being sent out. If that is preferred, please let me know and I'll send in another patch that does this.

PS: Another way to solve this would be to let the 3D viewport listen to the `NC_ANIMATION | ND_NLA | NA_EDITED` notifications that are already being sent out. If that is preferred, please let me know and I'll send in another patch that does this.

Note that, because of this code in wm_event_system.c function wm_event_do_notifiers around line 290:

		if (note->window == win ||
		    (note->window == NULL && (note->reference == NULL || note->reference == win->screen->scene)))
		{
			if (note->category == NC_SCENE) {
				if (note->data == ND_FRAME)
					do_anim = true;
			}
		}

we need to send NC_SCENE | ND_FRAME; without it, animation data isn't updated properly. We could also update wm_event_do_notifiers to set do_anim=true in other cases, for example when the category is NC_ANIMATION. That would actually be my preferred solution, but I don't know what would break/horribly slow down as a result.

Note that, because of this code in wm_event_system.c function `wm_event_do_notifiers` around line 290: if (note->window == win || (note->window == NULL && (note->reference == NULL || note->reference == win->screen->scene))) { if (note->category == NC_SCENE) { if (note->data == ND_FRAME) do_anim = true; } } we need to send `NC_SCENE | ND_FRAME`; without it, animation data isn't updated properly. We could also update `wm_event_do_notifiers` to set `do_anim=true` in other cases, for example when the category is `NC_ANIMATION`. That would actually be my preferred solution, but I don't know what would break/horribly slow down as a result.
Member

Added subscribers: @ideasman42, @JulianEisel

Added subscribers: @ideasman42, @JulianEisel
Member

Hey @sybrenstuvel,
thanks for the report, the patch and the research. The patch works fine for me.

@ideasman42, would you mind checking the patch?

Hey @sybrenstuvel, thanks for the report, the patch and the research. The patch works fine for me. @ideasman42, would you mind checking the patch?
Joshua Leung was assigned by Sergey Sharybin 2014-11-25 14:32:54 +01:00

Added subscribers: @JoshuaLeung, @Sergey

Added subscribers: @JoshuaLeung, @Sergey

NLA is more @JoshuaLeung's area.

The patch doesn't seems to be correct tho, you're forcing all the animation to be evaluated. Think you need to tag the particular animation to be evaluated instead. @JoshuaLeung, am i right here?

NLA is more @JoshuaLeung's area. The patch doesn't seems to be correct tho, you're forcing all the animation to be evaluated. Think you need to tag the particular animation to be evaluated instead. @JoshuaLeung, am i right here?

@Sergey: The NC_ANIMATION notification was already in the Blender source. If I should change the NULL in that line to something else, that's fine, but it's a different issue than what I intended to fix with this patch.

@Sergey: The `NC_ANIMATION` notification was already in the Blender source. If I should change the `NULL` in that line to something else, that's fine, but it's a different issue than what I intended to fix with this patch.

You shouldn't send NC_SCENE | ND_FRAME notifier unless the frame actually changes.

You shouldn't send `NC_SCENE | ND_FRAME` notifier unless the frame actually changes.

Good point, I'll update the patch to check that the (un)hidden NLA strip contains the current frame.

Good point, I'll update the patch to check that the (un)hidden NLA strip contains the current frame.
Updated patch: [0003-NLA-Fix-Hiding-unhiding-NLA-strip-doesn-t-update-the.patch](https://archive.blender.org/developer/F126606/0003-NLA-Fix-Hiding-unhiding-NLA-strip-doesn-t-update-the.patch)

This issue was referenced by e93990dfc5

This issue was referenced by e93990dfc5a8482c7e0b9b1c4d64ec8ec8095f65
Member

Changed status from 'Open' to: 'Resolved'

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

Closed by commit e93990dfc5.

Closed by commit e93990dfc5.
Member

I've just committed an alternative fix to master. As mentioned by Sergey, NC_SCENE | ND_FRAME should only be sent when the frame actually changes (i.e. when your operator changes the current frame). For animation channels, we have another mechanism (albeit only around for about 2-3 releases) which is better to use for such cases.

Anyways, thanks for your efforts in tracking down and providing a patch for this, even if we didn't ultimately use it :)

I've just committed an alternative fix to master. As mentioned by Sergey, `NC_SCENE | ND_FRAME` should only be sent when the frame actually changes (i.e. when your operator changes the current frame). For animation channels, we have another mechanism (albeit only around for about 2-3 releases) which is better to use for such cases. Anyways, thanks for your efforts in tracking down and providing a patch for this, even if we didn't ultimately use it :)
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
5 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#42697
No description provided.