WIP: world space copy/paste prototype #115675

Closed
Christoph Lendenfeld wants to merge 12 commits from ChrisLend/blender:world_space_copy into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.

This PR is not meant to be merged, rather it is an exploration to kick off discussion for such a feature.

Idea

When animating it is often needed to transfer the animation of an object into the space of a different parent.

  • You have animated the root bone, but now you need to transfer all that motion onto the hip + ik legs
  • Or you have animated an object in the space of a parent which itself has motion, but you want to bake out all that motion into world space.
  • Or you want to copy/paste animation between files and the hierarchy might not be the same.

That's where it is useful to copy animation data in world space.
You can then do the following workflow.

  • copy animation
  • do whatever changes are needed to the file
  • paste the animation back on and it will be exactly as before

Current Tools

Blender currently has the Copy Global Transform addon, which does a similar thing, but is limited to a single frame.

Ideally the tool to copy/paste animation will be implemented in C/C++ in order to be as fast as possible. The speedup will come from the ability to use a partial Dependency Graph to evaluate the scene, which should make the operator performant even in heavy scenes.
It also allows us to work with the keyframe array directly, which should be fast even with large mocap data files.

Design challenges

Which object gets which animation data.
It is clear when only one object is selected, or when the selection is the exact same between copy and paste.
But I can see a use case for pasting animation to a different set of objects, at which point you need to specify a mapping.
This might be only available through python, but allowing artists to specify that themselves would be very powerful.

Future Possibilities

By implementing a solid solution to store and apply world space data many more features will become possible.

  • unparent an animated object without it changing the animation in world space
  • sticking an object to another without parenting (paste with offset)
  • making sure objects are stuck in world space, even though their parent move
  • baking animation (exists but needs to step through the timeline making it slow)

Issues with this prototype

  • only works for single objects, even though a part of the code is set up to handle selection.
  • only for objects, bones would need to be supported as well
  • Using C to write a binary file to a location next to the user preferences. There might be a better place and a better way to do this.
  • skewed scaling probably won't work. But I haven't tested that. Probably fine to have that limitation

This PR is not meant to be merged, rather it is an exploration to kick off discussion for such a feature. # Idea When animating it is often needed to transfer the animation of an object into the space of a different parent. * You have animated the root bone, but now you need to transfer all that motion onto the hip + ik legs * Or you have animated an object in the space of a parent which itself has motion, but you want to bake out all that motion into world space. * Or you want to copy/paste animation between files and the hierarchy might not be the same. That's where it is useful to copy animation data in world space. You can then do the following workflow. * copy animation * do whatever changes are needed to the file * paste the animation back on and it will be exactly as before # Current Tools Blender currently has the `Copy Global Transform` addon, which does a similar thing, but is limited to a single frame. Ideally the tool to copy/paste animation will be implemented in C/C++ in order to be as fast as possible. The speedup will come from the ability to use a partial Dependency Graph to evaluate the scene, which should make the operator performant even in heavy scenes. It also allows us to work with the keyframe array directly, which should be fast even with large mocap data files. # Design challenges Which object gets which animation data. It is clear when only one object is selected, or when the selection is the exact same between copy and paste. But I can see a use case for pasting animation to a different set of objects, at which point you need to specify a mapping. This might be only available through python, but allowing artists to specify that themselves would be very powerful. # Future Possibilities By implementing a solid solution to store and apply world space data many more features will become possible. * unparent an animated object without it changing the animation in world space * sticking an object to another without parenting (paste with offset) * making sure objects are stuck in world space, even though their parent move * baking animation (exists but needs to step through the timeline making it slow) # Issues with this prototype * only works for single objects, even though a part of the code is set up to handle selection. * only for objects, bones would need to be supported as well * Using C to write a binary file to a location next to the user preferences. There might be a better place and a better way to do this. * skewed scaling probably won't work. But I haven't tested that. Probably fine to have that limitation ----- <video src="/attachments/b16cfa71-dd73-4713-b261-179a5eecff50" title="World Space Copy Paste" controls></video>
Christoph Lendenfeld added the
Module
Animation & Rigging
label 2023-12-01 16:42:41 +01:00
Christoph Lendenfeld added 12 commits 2023-12-01 16:42:53 +01:00

Pull request closed

Sign in to join this conversation.
No reviewers
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
1 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#115675
No description provided.