Give timeline marker default name when created via binding to camera #122968

Merged
Sybren A. Stüvel merged 4 commits from pioverfour/blender:dp_default_bind_marker_name into blender-v4.2-release 2024-06-19 11:22:39 +02:00
Member

Timeline markers get a default name of "F_" when creating with
marker.add, but an empty name with marker.camera_bind.
Because the name of the current frame's marker is displayed in the
viewport statistics, such markers appear as "<>" after the name of the
active object, which is confusing.

This change gives the same default name of "F_" to markers
created this way.
It also cleans up a comment in the line copied from, as that line was
introduced in late 2008 so probably not so temporary.


image

Timeline markers get a default name of "F_<frame>" when creating with `marker.add`, but an empty name with `marker.camera_bind`. Because the name of the current frame's marker is displayed in the viewport statistics, such markers appear as "<>" after the name of the active object, which is confusing. This change gives the same default name of "F_<frame>" to markers created this way. It also cleans up a comment in the line copied from, as that line was introduced in late 2008 so probably not so temporary. ----- ![image](/attachments/1132fde1-77cf-414b-84c2-8a61e7e44e37)
Damien Picard added 1 commit 2024-06-09 20:40:52 +02:00
Timeline markers get a default name of "F_<frame>" when creating with
`marker.add`, but an empty name with `marker.camera_bind`.
Because the name of the current frame's marker is displayed in the
viewport statistics, such markers appear as "<>" after the name of the
active object, which is confusing.

This change gives the same default name of "F_<frame>" to markers
created this way.
It also cleans up a comment in the line copied from, as that line was
introduced in late 2008 so probably not so temporary.
Sybren A. Stüvel added the
Module
Animation & Rigging
label 2024-06-10 09:43:35 +02:00
Sybren A. Stüvel reviewed 2024-06-10 09:47:28 +02:00
Sybren A. Stüvel left a comment
Member

Nice find! I think it might make more sense to name the marker after the camera, potentially with a frame number prefix/suffix to keep them unique. Would you agree? If so, please use ob->id.name+2 to get the camera object name.

Nice find! I think it might make more sense to name the marker after the camera, potentially with a frame number prefix/suffix to keep them unique. Would you agree? If so, please use `ob->id.name+2` to get the camera object name.
Author
Member

I think it might make more sense to name the marker after the camera

I didn’t do it because the camera’s name already overrides the marker’s when displayed in the timeline, so that feels redundant.

I’m not sure the current situation is the ideal though, I can see many situations when you do want to see the marker’s name, not the camera’s. If we removed this display override, then using the camera’s name for the marker’s would make a lot of sense!
I could open another PR if you agree, it’s a deeper change. No need to change this twice actually.

> I think it might make more sense to name the marker after the camera I didn’t do it because the camera’s name already overrides the marker’s when displayed in the timeline, so that feels redundant. I’m not sure the current situation is the ideal though, I can see many situations when you do want to see the marker’s name, not the camera’s. If we removed this display override, then using the camera’s name for the marker’s would make a lot of sense! ~~I could open another PR if you agree, it’s a deeper change.~~ No need to change this twice actually.

I think it might make more sense to name the marker after the camera

I didn’t do it because the camera’s name already overrides the marker’s when displayed in the timeline, so that feels redundant.

Good point. I think it would be good to add a comment to this effect to the SPRINTF call, so that readers know why they may not see the name that was set there.

I’m not sure the current situation is the ideal though, I can see many situations when you do want to see the marker’s name, not the camera’s. If we removed this display override, then using the camera’s name for the marker’s would make a lot of sense!
I could open another PR if you agree, it’s a deeper change. No need to change this twice actually.

It's indeed a bigger change. For now, I think it's fine to keep the current behaviour. In the long term, I want to have a different system entirely for switching "things", which should include the scene camera but not be so specific to that one feature. When we work on that, we can look at a better UI for presenting these switchover points. For more info, see the 'Channel Types' section in the Animation Workshop: June 2023 blog post.

> > I think it might make more sense to name the marker after the camera > > I didn’t do it because the camera’s name already overrides the marker’s when displayed in the timeline, so that feels redundant. Good point. I think it would be good to add a comment to this effect to the `SPRINTF` call, so that readers know why they may not see the name that was set there. > I’m not sure the current situation is the ideal though, I can see many situations when you do want to see the marker’s name, not the camera’s. If we removed this display override, then using the camera’s name for the marker’s would make a lot of sense! > ~~I could open another PR if you agree, it’s a deeper change.~~ No need to change this twice actually. It's indeed a bigger change. For now, I think it's fine to keep the current behaviour. In the long term, I want to have a different system entirely for switching "things", which should include the scene camera but not be so specific to that one feature. When we work on that, we can look at a better UI for presenting these switchover points. For more info, see the 'Channel Types' section in the [Animation Workshop: June 2023](https://code.blender.org/2023/07/animation-workshop-june-2023/#Channel-Types) blog post.
Damien Picard added 2 commits 2024-06-10 23:03:58 +02:00
Author
Member

it would be good to add a comment to this effect

Good idea, done!

see the 'Channel Types' section

Ooh nice, I forgot about that! It makes sense to wait until then.

> it would be good to add a comment to this effect Good idea, done! > see the 'Channel Types' section Ooh nice, I forgot about that! It makes sense to wait until then.
Sybren A. Stüvel added this to the 4.2 LTS milestone 2024-06-11 12:40:12 +02:00
Sybren A. Stüvel requested review from Sybren A. Stüvel 2024-06-11 12:40:20 +02:00
Sybren A. Stüvel requested review from Nathan Vegdahl 2024-06-11 12:40:31 +02:00
Nathan Vegdahl requested changes 2024-06-11 16:40:13 +02:00
Dismissed
Nathan Vegdahl left a comment
Member

Just a minor style nit. Otherwise looks good to me.

Just a minor style nit. Otherwise looks good to me.
@ -1871,6 +1871,9 @@ static int ed_marker_camera_bind_exec(bContext *C, wmOperator *op)
marker = ED_markers_find_nearest_marker(markers, scene->r.cfra);
if ((marker == nullptr) || (marker->frame != scene->r.cfra)) {
marker = static_cast<TimeMarker *>(MEM_callocN(sizeof(TimeMarker), "Camera TimeMarker"));
/* this marker's name is only displayed in the viewport statistics, animation editors use the
Member

Nit: use proper capitalization and punctuation in comments.

Nit: use proper capitalization and punctuation in comments.
Author
Member

Got it. I was thinking of the style guide’s “When making changes, conform to the style and conventions of the surrounding code.”

Got it. I was thinking of the style guide’s “When making changes, conform to the style and conventions of the surrounding code.”
pioverfour marked this conversation as resolved
Damien Picard added 1 commit 2024-06-11 19:01:48 +02:00
Capitalization and punctuation in comment
All checks were successful
buildbot/vexp-code-patch-lint Build done.
buildbot/vexp-code-patch-linux-x86_64 Build done.
buildbot/vexp-code-patch-windows-amd64 Build done.
buildbot/vexp-code-patch-darwin-x86_64 Build done.
buildbot/vexp-code-patch-darwin-arm64 Build done.
buildbot/vexp-code-patch-coordinator Build done.
38093be415
Nathan Vegdahl approved these changes 2024-06-13 09:41:46 +02:00
Nathan Vegdahl left a comment
Member

Looks good to me!

Looks good to me!
Sybren A. Stüvel approved these changes 2024-06-14 12:09:17 +02:00
Sybren A. Stüvel left a comment
Member

Looks good to me!

Looks good to me!

@blender-bot build

@blender-bot build
Author
Member

Hi, thanks for the reviews! Just to let you know: I don’t have the permissions to land this.

Hi, thanks for the reviews! Just to let you know: I don’t have the permissions to land this.
Sybren A. Stüvel merged commit 2948b1e790 into blender-v4.2-release 2024-06-19 11:22:39 +02:00
Sybren A. Stüvel deleted branch dp_default_bind_marker_name 2024-06-19 11:22:42 +02:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
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
Asset Browser Project
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
3 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#122968
No description provided.