Difference between revisions of "IC Python API:Novice Level Examples"
Chuck (RL) (Talk | contribs) m (→Batch Render Folder) |
Chuck (RL) (Talk | contribs) m (→Batch Render Folder) |
||
Line 9: | Line 9: | ||
|alignment=right | |alignment=right | ||
|description="Batch Render Folder" | |description="Batch Render Folder" | ||
+ | |container="frame" | ||
}} | }} | ||
Revision as of 01:19, 7 January 2019
- Main article: iClone Python API.
Batch Render Folder
This script can take multiple iClone projects within a directory and render each one to a separate video. It will automatically open each *.iProject file and perform the standard Render to Video with the expressed render settings taken from the scene (Render > Render Video). iClone will successively open each project file and scrub the timeline to capture each frame to an individual video file. This process can be interrupted at any moment by pressing the Cancel button in the modal window for each render procedure. The handy console log provided with the script dialog window will list out all of the detected iClone scenes and give a play-by-play of the current render task once executed. When the console log prints "Render completed!", the user can open the batch folder and find all of the videos conveniently residing in one location.
You Will Learn To
- Create a plugin for iClone.
- Create simple User Interface using a Qt UI file.
- Load projects and use render related APIs.
Required Files
- Batch Render Folder Python script - included in Python samples (main.py)
- QT UI form file (BatchRender.ui)
Steps to Take
- Setup a folder on your main drive for several *.iPojects to reside.
- Drag and drop several *.iProject files into this folder.
- Open up iClone and load the Batch Render Folder script (Plugins > Python Sample > Batch Render Folder).
- Within the dialog window, click on the Folder icon and pick the directory established beforehand.
- The console log below will print out the number of project files found.
- Click on the Render button and watch as iClone processes each file individually.
- Wait for the console log to print "Render completed!" and open the batch folder to find all of the processed videos.
Joint Driven Morph
This script can be used to drive morph targets via real-time rotation of bone joints. The character along with its bones and morphs are designated inside the script itself. Then every 100 milliseconds -about 1/10th of a second, the script will check for the rotational status of the associated bones and activate the subsequent morph targets accordingly. Once the joint morph connection is applied, one should see the activation of certain morph shapes by rotating the mapped joints in real-time.
You Will Learn How to
- Retrieve character data.
- Drive morph keys by changing attributes of another entity in the scene.
Required Files
- Example character (Test.iAvatar)
- Joint Driven Morph Python script (main.py)
Steps to take:
- Open iClone and load the sample avatar provided in this example into the scene (Test.iAvatar).
- Load the Joint Driven Morph python script (main.py) into the project (Script > Load Python > ...).
- In the subsequent popup window, click on Apply Join Morph Connection to make the joint to morph connection.
- Go into the Edit Motion Layer Panel and click on the elbow joint and rotate it to test the morph activation (Modify > Edit Motion Layer).