Difference between revisions of "IC Python API:Smooth Camera Follow"
Chuck (RL) (Talk | contribs) m (→Course Prerequisites) |
Chuck (RL) (Talk | contribs) m |
||
Line 2: | Line 2: | ||
{{Parent|IC_Python_API:RL_Python_Samples|RL Python Samples}} | {{Parent|IC_Python_API:RL_Python_Samples|RL Python Samples}} | ||
− | + | == Demo Video == | |
− | + | ||
− | + | ||
{{#evt: | {{#evt: | ||
Line 11: | Line 9: | ||
}} | }} | ||
− | + | == Description == | |
This script lets the user pick a camera/view and a prop/target to follow. The camera will always be facing the direction of the target prop with delay as an adjustable factor. The Offset values creates a distance between the view and the target. Use the Delay value to create a lag between the view and the target. | This script lets the user pick a camera/view and a prop/target to follow. The camera will always be facing the direction of the target prop with delay as an adjustable factor. The Offset values creates a distance between the view and the target. Use the Delay value to create a lag between the view and the target. | ||
Line 17: | Line 15: | ||
{{Single_Illustration|Smooth_Camera_Follow_Diagram.png|As the target prop starts to move, the camera will begin to follow with a specified delay. However, the camera's facing direction will always be locked onto the prop's pivot point no matter how fast the prop is moving.}} | {{Single_Illustration|Smooth_Camera_Follow_Diagram.png|As the target prop starts to move, the camera will begin to follow with a specified delay. However, the camera's facing direction will always be locked onto the prop's pivot point no matter how fast the prop is moving.}} | ||
− | + | == Course Prerequisites == | |
You should be familiar with the following fundamental articles before you proceed. | You should be familiar with the following fundamental articles before you proceed. | ||
Line 27: | Line 25: | ||
*[[ iC_Python_API:Float_Slider| Float Slider ]] | *[[ iC_Python_API:Float_Slider| Float Slider ]] | ||
− | + | == Learn How to == | |
+ | |||
* Drive the motion of the camera according to the animation of a prop. | * Drive the motion of the camera according to the animation of a prop. | ||
* Populate drop down menus/combo boxes with elements from the scene. | * Populate drop down menus/combo boxes with elements from the scene. | ||
− | + | == Required Files == | |
You can download this plugin from the [https://marketplace.reallusion.com/smooth-camera-follow Reallusion Marketplace]. | You can download this plugin from the [https://marketplace.reallusion.com/smooth-camera-follow Reallusion Marketplace]. | ||
Line 40: | Line 39: | ||
* Extensions Python script | * Extensions Python script | ||
− | + | == Steps to Take == | |
# Clone or download the Reallusion/iClone GitHub. | # Clone or download the Reallusion/iClone GitHub. | ||
Line 47: | Line 46: | ||
# Follow the instructions in the subsequent dialog window. | # Follow the instructions in the subsequent dialog window. | ||
− | + | == Code Flow == | |
Given a target prop and a target camera, the script will also require the inputs for the camera movement delay and offset position from the target prop. The code creates a new movement animation for the camera transformations by applying keys in the timeline. The final result is a camera that smoothly follows the target prop at the designated offset position with a certain degree of lag time decided by the user. | Given a target prop and a target camera, the script will also require the inputs for the camera movement delay and offset position from the target prop. The code creates a new movement animation for the camera transformations by applying keys in the timeline. The final result is a camera that smoothly follows the target prop at the designated offset position with a certain degree of lag time decided by the user. | ||
Line 53: | Line 52: | ||
{{Single_Illustration|Camera_WIKI_Code_Route.png}} | {{Single_Illustration|Camera_WIKI_Code_Route.png}} | ||
− | + | == Modules Used == | |
+ | |||
You can research the following references for the modules deployed in this code. | You can research the following references for the modules deployed in this code. | ||
− | + | ||
+ | === main.py === | ||
<div style="column-count:4; -moz-column-count:4; -webkit-column-count:4"> | <div style="column-count:4; -moz-column-count:4; -webkit-column-count:4"> | ||
* [[ IC_Python_API:RLPy_RMatrix3 | RLPy.RMatrix3() ]] | * [[ IC_Python_API:RLPy_RMatrix3 | RLPy.RMatrix3() ]] | ||
Line 70: | Line 71: | ||
* [[ IC_Python_API:RLPy_RVector3 | RLPy.RVector3() ]] | * [[ IC_Python_API:RLPy_RVector3 | RLPy.RVector3() ]] | ||
</div> | </div> | ||
− | + | ||
+ | === Extensions.py === | ||
+ | |||
<div style="column-count:4; -moz-column-count:4; -webkit-column-count:4"> | <div style="column-count:4; -moz-column-count:4; -webkit-column-count:4"> | ||
* [[ IC_Python_API:RLPy_RMath#Abs | RLPy.RMath.Abs() ]] | * [[ IC_Python_API:RLPy_RMath#Abs | RLPy.RMath.Abs() ]] |
Revision as of 22:44, 25 June 2019
- Main article: RL Python Samples.
Demo Video
Description
This script lets the user pick a camera/view and a prop/target to follow. The camera will always be facing the direction of the target prop with delay as an adjustable factor. The Offset values creates a distance between the view and the target. Use the Delay value to create a lag between the view and the target.
Course Prerequisites
You should be familiar with the following fundamental articles before you proceed.
Learn How to
- Drive the motion of the camera according to the animation of a prop.
- Populate drop down menus/combo boxes with elements from the scene.
Required Files
You can download this plugin from the Reallusion Marketplace. To acquire and view the source code, please visit Reallusion GitHub.
- iClone scene with camera and animated prop
- Smooth Camera Follow Python script
- Extensions Python script
Steps to Take
- Clone or download the Reallusion/iClone GitHub.
- Copy SmoothCameraFollow folder into the iClone install directory > ...\Bin64\OpenPlugin.
- Load the script into the project from the menu: Plugins > Python Samples > Smooth Camera Follow.
- Follow the instructions in the subsequent dialog window.
Code Flow
Given a target prop and a target camera, the script will also require the inputs for the camera movement delay and offset position from the target prop. The code creates a new movement animation for the camera transformations by applying keys in the timeline. The final result is a camera that smoothly follows the target prop at the designated offset position with a certain degree of lag time decided by the user.
Modules Used
You can research the following references for the modules deployed in this code.