Pose marker in camera action + marker bound to camera → crash #49489

Closed
opened 2016-09-29 09:48:26 +02:00 by Sybren A. Stüvel · 14 comments

System Information
Kubuntu 16.04

Blender Version
Broken: current master (78c380d3b8)
Worked: unknown

Short description of error
When a pose marker is bound to a camera, and the pose marker is part of the camera's own action, it causes a crash when Blender opens the file. It seems to only happen when Blender is opened with that file, or when another file (or the default scene) was loaded first.

Exact steps for others to reproduce the error

  1. Open this blend file posemarker-cam-crash1.blend
  2. Crash

How to create this file:

  1. Start with this file posemarker-cam-crash.blend
  2. With the camera still selected, hover mouse over the pose marker F_30
  3. Save the file
  4. Open a another file, or close Blender completely.
  5. Open the file in Blender.
  6. Crash
**System Information** Kubuntu 16.04 **Blender Version** Broken: current master (78c380d3b84d53bf099b49571f0df67bea95bce2) Worked: unknown **Short description of error** When a pose marker is bound to a camera, and the pose marker is part of the camera's own action, it causes a crash when Blender opens the file. It seems to only happen when Blender is opened with that file, or when another file (or the default scene) was loaded first. **Exact steps for others to reproduce the error** 1. Open this blend file [posemarker-cam-crash1.blend](https://archive.blender.org/developer/F370461/posemarker-cam-crash1.blend) 2. Crash How to create this file: 1. Start with this file [posemarker-cam-crash.blend](https://archive.blender.org/developer/F370460/posemarker-cam-crash.blend) 2. With the camera still selected, hover mouse over the pose marker F_30 3. Save the file 4. Open a another file, or close Blender completely. 5. Open the file in Blender. 6. Crash
Author
Member

Changed status to: 'Open'

Changed status to: 'Open'
Author
Member

Added subscriber: @dr.sybren

Added subscriber: @dr.sybren
Author
Member

The crash happens at anim_markers.c:408. The marker->camera pointer is not NULL, but not valid either.

The crash happens at `anim_markers.c:408`. The `marker->camera` pointer is not `NULL`, but not valid either.

Added subscriber: @mont29

Added subscriber: @mont29

This is not actually a bug… action markers are not supposed to have cameras currently (scene ones either, actually, it’s a “temp Durian hack”, lol).

P406: #49489.diff

diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 60f276b..f204456 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -2498,6 +2498,7 @@ static void lib_link_action(FileData *fd, Main *main)
 {
 	bAction *act;
 	bActionChannel *chan;
+	TimeMarker *marker;
 
 	for (act = main->action.first; act; act = act->id.next) {
 		if (act->id.tag & LIB_TAG_NEED_LINK) {
@@ -2511,6 +2512,17 @@ static void lib_link_action(FileData *fd, Main *main)
 // >>> XXX deprecated - old animation system
 			
 			lib_link_fcurves(fd, &act->id, &act->curves);
+
+#ifdef DURIAN_CAMERA_SWITCH
+			for (marker = act->markers.first; marker; marker = marker->next) {
+				if (marker->camera) {
+					marker->camera = newlibadr(fd, act->id.lib, marker->camera);
+				}
+			}
+#else
+			(void)marker;
+#endif
+
 		}
 	}
 }
@@ -8860,6 +8872,18 @@ static void expand_action(FileData *fd, Main *mainvar, bAction *act)
 	
 	/* F-Curves in Action */
 	expand_fcurves(fd, mainvar, &act->curves);
+
+#ifdef DURIAN_CAMERA_SWITCH
+	{
+		TimeMarker *marker;
+
+		for (marker = act->markers.first; marker; marker = marker->next) {
+			if (marker->camera) {
+				expand_doit(fd, mainvar, marker->camera);
+			}
+		}
+	}
+#endif
 }
 
 static void expand_keyingsets(FileData *fd, Main *mainvar, ListBase *list)

adds needed read bits to correctly handle camera pointers in actions markers.

Note however that camera markers pointers are also missing from lib_query looper.

But imho, this should be added to some temp branch (or blender2.8), does not really makes sense to do changes here in master?

This is not actually a bug… action markers are not supposed to have cameras currently (scene ones either, actually, it’s a “temp Durian hack”, lol). [P406: #49489.diff](https://archive.blender.org/developer/P406.txt) ``` diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 60f276b..f204456 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -2498,6 +2498,7 @@ static void lib_link_action(FileData *fd, Main *main) { bAction *act; bActionChannel *chan; + TimeMarker *marker; for (act = main->action.first; act; act = act->id.next) { if (act->id.tag & LIB_TAG_NEED_LINK) { @@ -2511,6 +2512,17 @@ static void lib_link_action(FileData *fd, Main *main) // >>> XXX deprecated - old animation system lib_link_fcurves(fd, &act->id, &act->curves); + +#ifdef DURIAN_CAMERA_SWITCH + for (marker = act->markers.first; marker; marker = marker->next) { + if (marker->camera) { + marker->camera = newlibadr(fd, act->id.lib, marker->camera); + } + } +#else + (void)marker; +#endif + } } } @@ -8860,6 +8872,18 @@ static void expand_action(FileData *fd, Main *mainvar, bAction *act) /* F-Curves in Action */ expand_fcurves(fd, mainvar, &act->curves); + +#ifdef DURIAN_CAMERA_SWITCH + { + TimeMarker *marker; + + for (marker = act->markers.first; marker; marker = marker->next) { + if (marker->camera) { + expand_doit(fd, mainvar, marker->camera); + } + } + } +#endif } static void expand_keyingsets(FileData *fd, Main *mainvar, ListBase *list) ``` adds needed read bits to correctly handle camera pointers in actions markers. Note however that camera markers pointers are also missing from lib_query looper. But imho, this should be added to some temp branch (or blender2.8), does not really makes sense to do changes here in master?

Added subscriber: @Sergey

Added subscriber: @Sergey

@mont29, we are on c11 now, so you can do for (Marker *foo = ...). I also not sure why to fix crash only in 2.8 branch?

@mont29, we are on c11 now, so you can do `for (Marker *foo = ...)`. I also not sure why to fix crash only in 2.8 branch?
Author
Member

The ability to link a camera to a marker is very useful, especially for the pose library, so that we can automatically render a pose from a certain camera. I don't care much for the user interface (I can create my own), but the data model is quite useful.

I also feel this should be fixed in master. This bug now can produce a file that crashes Blender and can't be fixed (without hacking binary stuff yourself).

The ability to link a camera to a marker is very useful, especially for the pose library, so that we can automatically render a pose from a certain camera. I don't care much for the user interface (I can create my own), but the data model is quite useful. I also feel this should be fixed in master. This bug now can produce a file that crashes Blender and can't be fixed (without hacking binary stuff yourself).

What I mean is that this feature (ob pointer in marker) is, in current master, an (old, Durian) hack with very poor/incomplete support.

Fixing it is easy - but it would only be needed for new poselib system, which is 2.8 area… In current Blender, there is no way for user to set the ob pointer of an action marker (afaik?), this is only doable through RNA API.

What I mean is that this feature (ob pointer in marker) is, in current master, an (old, Durian) hack with very poor/incomplete support. Fixing it is easy - but it would only be needed for new poselib system, which is 2.8 area… In current Blender, there is no way for user to set the ob pointer of an action marker (afaik?), this is only doable through RNA API.
Member

Added subscriber: @JoshuaLeung

Added subscriber: @JoshuaLeung
Member

Er... I think there might be a way to have markers-with-cameras-attached created in master by users without using py/rna. IIRC we have an operator to copy the current set of scene markers (or maybe just the selected ones) to be action markers instead. Check the action editor markers menu.

My 2 cents: IMO, in this case we should be fixing this crash in master.

Er... I think there might be a way to have markers-with-cameras-attached created in master by users without using py/rna. IIRC we have an operator to copy the current set of scene markers (or maybe just the selected ones) to be action markers instead. Check the action editor markers menu. My 2 cents: IMO, in this case we should be fixing this crash in master.

Uuuuhhhh… OK… then yes, will fix that in master…

And will remove that 'durina hack' ifdef around core places where this pointer is handled (i.e. readfile.c and lib_query.c), too.

Uuuuhhhh… OK… then yes, will fix that in master… And will remove that 'durina hack' ifdef around core places where this pointer is handled (i.e. readfile.c and lib_query.c), too.

This issue was referenced by 85d543b4ac

This issue was referenced by 85d543b4acb35750ea81e12cc7c1cc5db55ce361

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
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#49489
No description provided.