Profile Picture

X-Mirror / Invert Clip Script

Posted By 4u2ges 5 Years Ago
Rated 5 stars based on 4 votes.
Author
Message
4u2ges
4u2ges
Posted 5 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (22.3K reputation)Distinguished Member (22.3K reputation)Distinguished Member (22.3K reputation)Distinguished Member (22.3K reputation)Distinguished Member (22.3K reputation)Distinguished Member (22.3K reputation)Distinguished Member (22.3K reputation)Distinguished Member (22.3K reputation)Distinguished Member (22.3K reputation)

Group: Forum Members
Last Active: Last Month
Posts: 5.3K, Visits: 16.8K
I actually have 2 scripts to present. They both are based on Pose Manager plugin script, but they work differently.
Both have about 99% mirror/invert precision. Both are slow (thought second script is twice as fast compare to first).

The problem I was facing here is with Set and Get data. Get data works with Scene time, Set data works with Clip Time.
Conversion Time to Frame and vice versa (which requires an extreme precision in this case), goes out of wack.
You guys may take a look at it and see if you can facilitate routines and make it faster. I did my best to make it working.

Before running scripts make sure to check every option in Animation > Motion Settings Options.

Invert_Clip.py - Mirrors the clip from one avatar to another.
* You have to have 2 avatars in the scene (spread them apart by X for best visual).
* Make sure avatars do not have a clips at frame 1. By default they do. So delete clip at first frame.
* Open script in an editor and specify 2 avatar names at the top. You may change clip_step from 1 to 2, or 3.
   Higher number makes the script to run faster. Number indicates how frequently to insert a clip. 1 - every frame, 2 every second frame, etc.
   Experiment to see if the high number of steps is acceptable for your clip.
* Add a clip to the avatar you specified first (clip does not have to start at frame 1)
* Load script and wait :Whistling: (go have a coffee or something...) With clip_step = 1, 10 seconds clip would take about 4 minutes to mirror.

At the end the second avatar should be assigned a mirrored clip for every frame (if clip_step = 1)
DO NOT attempt to merge those clips, nor Flatten them (that would invalidate them). Use Collect Clip and Add Motion to Library.
What interesting about this method is, that at the end, Mirrored clips are 100% match the original (you may use Orthogonal camera to verify).
However, when you use Collect Clip, save and add the resulted clip back to the timeline, there is a barely noticeable mismatch (no idea why...).

Invert_Clip2.py - creates a Mirrored clip to the right from the original for the same avatar.
* Load an avatar and delete a clip at frame 1.
* Optional: Open script in an editor and change clip_step value.   
   Higher number makes the script to run faster. Number indicates how frequently to insert a frame into the inverted clip. 1 - every frame, 2 every second frame, etc.
   Experiment to see if the high number of steps is acceptable for your clip. clip_offset specifies how far apart should mirrored clip be located from the original (default is 20 frames).
* Add a clip to the avatar (clip does not have to start at first frame).  Important: make sure you have enough frames at the timeline for the mirrored clip.
* Make sure avatar is selected, load script and wait. This one is faster. 10 sec clip mirrored in about 1.5 minute with clip_step = 1
At the end a single mirrored clip should be created to the right from the original. As with first script, DO NOT attempt to flatten mirrored clip. You may use Collect Clip and Add to Motion Library.
Or save the clip, add it back to the timeline, Now you may flatten it and save again.
This script is also produces a mirrored clip with barely noticeable difference for the original.

Here is a video for creating invert clip with Invert_Clip2.py (I cut out the script running time)



Feel free to comment, ask questions, customize / modify / add UI, or write your own script/plugin and share.




Update: Invert_CLip2.py was updated to force Avatar selection. If you did not select an Avatar you would get a friendly reminder.




Attachments
Invert.zip (662 views, 2.00 KB)

Threaded View

Threaded View
Forum Post X-Mirror / Invert Clip Script By 4u2ges ( 5 Years Ago )
Forum Post Brilliant work again Gurgen, now all that we need is a Nobel Prize for... By wires ( 5 Years Ago )
Forum Post RE: X-Mirror / Invert Clip Script By 4u2ges ( 5 Years Ago )
Forum Post Great work Gurgen! :) I am happy to see this finally get a method... By Rampa ( 5 Years Ago )
Forum Post Thanks Rampa :) By 4u2ges ( 5 Years Ago )
Forum Post Is it quick and easy to add some code to automatically grab the... By Rampa ( 5 Years Ago )
Forum Post Glad you did this, Mr. G, sure saves me (to show you how little time I... By Kelleytoons ( 5 Years Ago )
Forum Post Yes, it sure is. I will update... By 4u2ges ( 5 Years Ago )
Forum Post Updated to have second script to force avatar selection. By 4u2ges ( 5 Years Ago )
Forum Post Works pretty great! :) That has been wanted for a long time. By Rampa ( 5 Years Ago )
Forum Post Brilliant! Thankyou so much!! πŸ‘πŸ‘ Can't tell you how many times I've... By John From Oz ( 5 Years Ago )
Forum Post Thank you folks, I am happy myself, that this is finally possible... By 4u2ges ( 5 Years Ago )
Forum Post Great job, Gurgen! And a sincere thank you for sharing it with the... By GrannyJ ( 5 Years Ago )
Forum Post Wow, that's great! :w00t: EDIT this statement is no longer valid!... By toystorylab ( 5 Years Ago )
Forum Post Thank you GrannyJ :) No, no, no Toystory! You do not have to change... By 4u2ges ( 5 Years Ago )
Forum Post [quote][b]4u2ges (10/9/2020)[/b][hr]Thank you GrannyJ :) No, no, no... By toystorylab ( 5 Years Ago )
Forum Post @4u2ges That's great, Many Thanks. :) :) Best regards rosuckmedia By rosuckmedia ( 5 Years Ago )
Forum Post @rosuckmedia, @toystorylab Thanks guys for checking it out :) By 4u2ges ( 5 Years Ago )
Forum Post I knew you could do it!!! :But I deserve something for waiting... By mark ( 5 Years Ago )
Forum Post @4u2ges That's great, Thanks for sharing! By Hewa' s Art ( 5 Years Ago )
Forum Post You sir, are a king THANK YOU By davidmaximo ( 5 Years Ago )
Forum Post You really are a master of iClone. By mikahawkins ( 5 Years Ago )
Forum Post Thank you guys! I am really happy it all worked out good for you :)... By 4u2ges ( 5 Years Ago )
Forum Post wow amazing never thought i would need this till i saw it :D thank you... By ahingel ( 5 Years Ago )
Forum Post [quote][b]ahingel (10/11/2020)[/b][hr]wow amazing never thought i... By 4u2ges ( 5 Years Ago )
Forum Post Just discovered this. Have not had a chance to check it out fully, but... By Cary B ( 4 Years Ago )
Forum Post Woooww. Used it for the first time. Simply simple , quick and work... By charly Rama ( 4 Years Ago )
Forum Post Thanks Charly. I'm glad it helped that many people. :) By 4u2ges ( 4 Years Ago )
Forum Post Absolutely brilliant. Exactly what I was looking for. How on earth do... By woody173 ( 4 Years Ago )
Forum Post [quote][b]woody173 (6/5/2021)[/b][hr]Absolutely brilliant. Exactly... By 4u2ges ( 4 Years Ago )
Forum Post Thankyou for working on this kind sir! Works great By jeremymonroe1 ( 4 Years Ago )
Forum Post No problem. Glad, it worked out for you well :) By 4u2ges ( 4 Years Ago )
Forum Post Brilliant! By dpolcino ( 4 Years Ago )
Forum Post Thanks :) By 4u2ges ( 4 Years Ago )



Reading This Topic