Difference between revisions of "IC Python API:Camera Dolly Zoom"
Chuck (RL) (Talk | contribs) (Created page with "{{TOC}} {{Parent|IC_Python_API:RL_Python_Samples|RL Python Samples}} == Demo Video == == Description == Dolly Zoom is an in-camera effect that utilizes perspective distort...") |
Chuck (RL) (Talk | contribs) m (→Usage Instructions) |
||
Line 36: | Line 36: | ||
#Clone or download the Reallusion/iClone GitHub. | #Clone or download the Reallusion/iClone GitHub. | ||
− | #Copy | + | #Copy '''Camera_Dolly_Zoom''' folder into the iClone install directory > '''...\Bin64\OpenPlugin'''. |
− | #Load the script into the project from the menu: | + | #Load the script into the project from the menu: '''Plugins > Python Samples > Camera Dolly Zoom'''. |
#Create a new camera and pick an item in the scene. | #Create a new camera and pick an item in the scene. | ||
#Adjust the settings and press the '''Key Dolly Zoom''' button. | #Adjust the settings and press the '''Key Dolly Zoom''' button. |
Revision as of 00:10, 16 October 2019
- Main article: RL Python Samples.
Demo Video
Description
Dolly Zoom is an in-camera effect that utilizes perspective distortion to make the background appear as if it’s changing its size relative to the subject. The visual appearance for the viewer is that either the background suddenly grows in size and detail to overwhelm the foreground, or the foreground becomes immense and dominates the previous setting, depending on which way the dolly zoom is executed. This script simulates the Dolly Zoom effect by animating the camera's Focal Length and positioning according to the current camera settings and the desired Focal Length. Automatic Depth of Field on the target object is an optional setting.
Course Prerequisites
You should familiarize yourself with the following fundamental articles before you proceed:
Takeaway Lessons
- Calculate the dolly zoom effect with a simple formula.
- Locally translate an object in code in spite of the world-space transformation system.
Required Files
- Camera Dolly Zoom Python script
- iClone scene with selectable props or characters, preferably in a setting filled with background objects.
Usage Instructions
- Clone or download the Reallusion/iClone GitHub.
- Copy Camera_Dolly_Zoom folder into the iClone install directory > ...\Bin64\OpenPlugin.
- Load the script into the project from the menu: Plugins > Python Samples > Camera Dolly Zoom.
- Create a new camera and pick an item in the scene.
- Adjust the settings and press the Key Dolly Zoom button.
Code Flow
- The current viewing camera is the currently driven camera.
- The current selection is the DOF target, the first item in multiple selection is designated as the target.
- Adjust the parameters such as Auto-Distance and Auto-Range toggle and multiplier.
- The z-distance between the target prop from the current viewing camera is calculated.
- DOF key is created taking into account the depth distance value and the parameter settings.
- The created DOF key is set on the current viewing camera in near real-time.
APIs Used
You can research the following references for the APIs deployed in this code.
- RLPy.RMatrix4()
- RLPy.RPyTimerCallback.__init__()
- RLPy.RDialogCallback.__init__()
- RLPy.RScene.GetCurrentCamera()
- RLPy.RGlobal.GetTime()
- RLPy.RScene.GetSelectedObjects()
- RLPy.RGlobal.SetTime()
- RLPy.RTime()
- RLPy.RUi.ShowMessageBox()
- RLPy.RGlobal.GetFps()
- RLPy.RTime.GetFrameIndex()
- RLPy.RVector3()
- RLPy.RVariant()
- RLPy.RKey()
- RLPy.RGlobal.Play()
- RLPy.RUi.CreateRDialog()
- RLPy.RPyTimer()
- RLPy.RUi.GetMainWindow()
- RLPy.RUi.AddMenu()