Trying to hack FCP's Spinback3D plug-in, need FXBuilder help
I come from a PHP programming background, so code is not a new concept, though I have yet to delve into FXBuilder...
FCP's Spinback3D is a 3D Simulation transition effect that rotates your outgoing clip ~90° (looks more like ~85°), swaps it for the incoming clip, and reverses the rotation... it isn't a 180° flip, which is what I want. Sure, I can achieve this with motion keyframes, but I want to do this for several clips and the plugin just makes sense (why the built in plugin doesn't have this as an option, i do not know) It appears to me that the section of code that governs the rotation is: Code:
rotate3D(target3d, center3d, 0, 0, -angleofaxis); It should be a simple task, to hack the plugin (or a copy of the plugin... I called it Flip 180) to simply do what it does, but in a full 180° turn. Anyone have any ideas? |
Full code
Here is the full FXBuilder code for the Spinback3D plug-in:
Code:
scriptid "Spinback3D" //DO NOT LOCALIZE |
"ratio" in FxScript pertains to how far through the effect you have progressed (0 at the start to 1 at the end)
what the script is doing then is a simple "if then" conditional switch if less than half way through the effect then rotate the outgoing clip 180 degrees times the ratio ( so the maximum rotation at ratio of 0.5 will be 90 degrees ) otherwise do the reverse with the incoming clip so, you need to change that code to: rotate3D(target3d, center3d, 0, 0, -angleofaxis); if ratio < 0.5 rotate3D(target3d, center3d, 0, 360*ratio, 0); else rotate3D(target3d, center3d, 0, 360*(1-ratio), 0); end if; rotate3D(target3d, center3d, 0, 0, angleofaxis); that'll do what you want (but you may not like the result as the 180 degrees to the angle of view just means you're looking at a flipped image when it cuts ... might want to try changing it to 540 degrees for something more dynamic) |
Quote:
Code:
if ratio < 0.5 So, for those interested in a simple 3D flip transition, here is the code: Code:
scriptid "Flipper" //DO NOT LOCALIZE |
cool.
lets add a couple of extra controls in there: input spinfactor, "Spin Factor", slider, 1, 1, 10 snap 1, 2, 3, 4, 5, 6, 7, 8, 9, 10; input doflip, "Flip", checkbox, 1 then change the code snippet to: if ratio < 0.5 rotate3D(target3d, center3d, 0, spinfactor*180*ratio, 0); else if doflip rotate3D(target3d, center3d, 0, spinfactor*180*(1+ratio), 0); else rotate3D(target3d, center3d, 0, spinfactor*180*(1-ratio), 0); end if end if; |
Quote:
Do you know of any good websites or books for learning FXBuilder? I would really like to dive into this stuff (not that I have any free time, but I am interested). I'm thinking of trying to hack the Page Peel to see if I can replicate the CC Twister plugin from AfterEffects... that appears to be a much bigger task than a simple flip! |
hands down best place to get your feet wet is by absorbing all you can over on Joe Mallers website ...
http://joemaller.com/fcp/fxscript_basics.shtml ... read all the tutorials, download all the example, explorer and debug scripts, check out all the links from his site. its easily the best resource also check out his FxScript Reference site http://www.fxscriptreference.org/ Open up all of Apple's scripts and have at them. Tweak the code and see how it affects the runtime ... a great way to figure out how it all works. Matt Sandstrom's Too Much Too Soon plugs are excellent and he offers them free and unlocked so that you can see his code and so see how others might code similar effects yet using different function calls http://www.mattias.nu/plugins/ last but certainly not least, grab the Using FxScript document off Apple's Developer website http://developer.apple.com/documenta...ngFXScript.pdf |
All times are GMT -6. The time now is 05:54 PM. |
DV Info Net -- Real Names, Real People, Real Info!
1998-2024 The Digital Video Information Network