Anim: Unit Tests for "Insert Available" #116327
No reviewers
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
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#116327
Loading…
Reference in New Issue
No description provided.
Delete Branch "ChrisLend/blender:tests_keyingsets"
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?
In preparation to the upcoming refactor of the keying set code,
extend the unit tests with more sophisticated
tests for "Insert Available".
This PR tests
@ -319,0 +303,4 @@
bpy.context.scene.tool_settings.use_keyframe_insert_auto = True
bpy.context.preferences.edit.use_keyframe_insert_available = True
with bpy.context.temp_override(**_get_view3d_context()):
It would be nice if this could use something like:
Probably not for this PR, though ;-)
is this a function that exists in bpy or would I have to create that?
I don't think it's there, it would just be:
At least I think that would work. If not Python is stupid and this can be ignored ;-)
@ -319,0 +324,4 @@
for fcurve in action.fcurves:
if "location" in fcurve.data_path:
self.assertEqual(len(fcurve.keyframe_points), 2)
Is the distinction between the 'rotation' and 'location' cases relevant here? Or could these two cases be merged with
if any(substring in fcurve.data_path for substring in {'location', 'rotation'})
(or a more boring"location" in fcurve.data_path or "rotation" in fcurve.data_path
)?(same for the identical construct below)
did the boring way, I find that easier to read
@ -319,0 +326,4 @@
if "location" in fcurve.data_path:
self.assertEqual(len(fcurve.keyframe_points), 2)
elif "rotation" in fcurve.data_path:
# Moving the bone would also add rotation keys as long as "Only Insert Needed" is off.
Avoid the word "moving" in situations where there's a distinction between "translating" and "rotating". If this ambiguity is intentional, I'd write something like "Any transformation of the bone would ..."
@ -319,0 +329,4 @@
# Moving the bone would also add rotation keys as long as "Only Insert Needed" is off.
self.assertEqual(len(fcurve.keyframe_points), 2)
else:
raise AssertionError("Did not expect keys other than location and rotation")
Include the data_path in this error, to help debug the situation when it occurs.
@ -319,0 +381,4 @@
with bpy.context.temp_override(**_get_view3d_context()):
self.assertRaises(RuntimeError, bpy.ops.anim.keyframe_insert_by_name, type="Available")
self.assertTrue(keyed_object.animation_data is None)
Use
assertIsNone
(docs).