Difference between revisions of "IC Python API:Smooth Camera Follow"

From Reallusion Wiki!
Jump to: navigation, search
m
m (Required Files)
Line 31: Line 31:
 
=== Required Files ===
 
=== Required Files ===
  
You can view and download the sample code and related files from this [https://github.com/reallusion/iClone/tree/master/SmoothCameraFollow GitHub Page] or from the [https://marketplace.reallusion.com/smooth-camera-follow Reallusion Marketplace].
+
You can download the plugin from the [https://marketplace.reallusion.com/smooth-camera-follow Reallusion Marketplace]. 
 +
You can also view and download the sample code and related files from this [https://github.com/reallusion/iClone/tree/master/SmoothCameraFollow GitHub Page].
  
 
* iClone scene with camera and animated prop
 
* iClone scene with camera and animated prop

Revision as of 02:04, 2 May 2019

Main article: RL Python Samples.

Smooth Camera Follow

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.

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.

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 the plugin from the Reallusion Marketplace. You can also view and download the sample code and related files from this GitHub Page.

  • iClone scene with camera and animated prop
  • Smooth Camera Follow Python script
  • Extensions Python script

Steps to Take

  1. Clone or download the Reallusion/iClone GitHub.
  2. Copy SmoothCameraFollow folder into the iClone install directory > ...\Bin64\OpenPlugin.
  3. Load the script into the project from the menu: Plugins > Python Samples > Smooth Camera Follow.
  4. 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.

Camera WIKI Code Route.png

Modules Used

You can research the following references for the modules deployed in this code.

main.py

Extensions.py