Difference between revisions of "IC Python API:Intermediate Level Examples"

From Reallusion Wiki!
Jump to: navigation, search
(Created page with "{{TOC}} {{Parent|IC_Python_API|iClone Python API}} == Group Manager == Group Manager is a utility that creates layer controls for iClone. When using Group Manager, every obj...")
 
m
 
(3 intermediate revisions by the same user not shown)
Line 3: Line 3:
  
 
== Group Manager ==
 
== Group Manager ==
 +
 +
{{#evt:
 +
service=youtube
 +
|id=https://www.youtube.com/watch?v=ACOz0dWeMMo&list=PLNV5zSFadPdnhNttpXa1YtstjTnFjA6qF&t=0s&index=5
 +
|alignment=right
 +
|description=Group Manager
 +
|container=frame
 +
}}
  
 
Group Manager is a utility that creates layer controls for iClone. When using Group Manager, every object that is created within iClone is placed under a group - usually the World group. Each group has it's own properties - and each object assumes the properties of the group it exists under. Group can operate on its child elements in a single operation such as toggling visibility. Once the Group Manager is initiated a dialog window will appear containing operational instructions and a default group containing everything in the scene (Group_0). You can create a new empty group by right-clicking on an empty area and assign it items from the default group. You can also double-click on the group label to rename the group and toggle the checkmark beside it to show/hide items belonging to that group.
 
Group Manager is a utility that creates layer controls for iClone. When using Group Manager, every object that is created within iClone is placed under a group - usually the World group. Each group has it's own properties - and each object assumes the properties of the group it exists under. Group can operate on its child elements in a single operation such as toggling visibility. Once the Group Manager is initiated a dialog window will appear containing operational instructions and a default group containing everything in the scene (Group_0). You can create a new empty group by right-clicking on an empty area and assign it items from the default group. You can also double-click on the group label to rename the group and toggle the checkmark beside it to show/hide items belonging to that group.
Line 24: Line 32:
  
 
== Musical keyboard==
 
== Musical keyboard==
 +
 +
{{#evt:
 +
service=youtube
 +
|id=https://www.youtube.com/watch?v=ksU-Z-b5vo8&list=PLNV5zSFadPdnhNttpXa1YtstjTnFjA6qF&t=0s&index=2
 +
|alignment=right
 +
|description=Musical Keyboard
 +
|container=frame
 +
}}
  
 
Musical keyboard is a demonstration of creating key-press events that can respond in real-time making for an interactive user experience that can control elements in the scene. Once the script is initiated, a dialog window will appear with all the available keys mapped out. One can press on the corresponding keyboard letter and hear the note being played while the keyboard responds in kind. The sample scene file (Keyboard.iProject) also contains a prerecording in the form of a animation track (example: Timeline > Key_C > Transform/Sound).
 
Musical keyboard is a demonstration of creating key-press events that can respond in real-time making for an interactive user experience that can control elements in the scene. Once the script is initiated, a dialog window will appear with all the available keys mapped out. One can press on the corresponding keyboard letter and hear the note being played while the keyboard responds in kind. The sample scene file (Keyboard.iProject) also contains a prerecording in the form of a animation track (example: Timeline > Key_C > Transform/Sound).
Line 29: Line 45:
 
===You Will Learn how to===
 
===You Will Learn how to===
  
Use hot key to control props and emit sounds.
+
*Use hot key to control props and emit sounds.
  
 
===Required Files===  
 
===Required Files===  
Line 35: Line 51:
 
[https://github.com/reallusion/iClone/tree/master/Keyboard GitHUB Page]
 
[https://github.com/reallusion/iClone/tree/master/Keyboard GitHUB Page]
  
iClone scene containing the keyboard prop (Keyboard.iProject)
+
*iClone scene containing the keyboard prop (Keyboard.iProject)
Keyboard Python script (main.py)
+
*Keyboard Python script (main.py)
Various WAV files containing individual key note sounds (wav folder).
+
*Various WAV files containing individual key note sounds (wav folder).
  
===Steps to take===
+
===Steps to Take===
  
Open the scene file provided in this section (Keyboard.iProject).
+
#Open the scene file provided in this section (Keyboard.iProject).
Make the wav folder resides in the same directory as the python script (main.py).
+
#Make the wav folder resides in the same directory as the python script (main.py).
Press the keys: [C], [D], [E], [F], [G], [A], [B] and watch as the keyboard keys begin to press and produce unique notes.
+
#Press the keys: [C], [D], [E], [F], [G], [A], [B] and watch as the keyboard keys begin to press and produce unique notes.
On the other hand, you can simply play the timeline to watch a pre-recording.
+
#On the other hand, you can simply play the timeline to watch a pre-recording.

Latest revision as of 18:26, 7 January 2019

Main article: iClone Python API.

Group Manager

Group Manager

Group Manager is a utility that creates layer controls for iClone. When using Group Manager, every object that is created within iClone is placed under a group - usually the World group. Each group has it's own properties - and each object assumes the properties of the group it exists under. Group can operate on its child elements in a single operation such as toggling visibility. Once the Group Manager is initiated a dialog window will appear containing operational instructions and a default group containing everything in the scene (Group_0). You can create a new empty group by right-clicking on an empty area and assign it items from the default group. You can also double-click on the group label to rename the group and toggle the checkmark beside it to show/hide items belonging to that group.

You Will Learn How to

  • Create UI using Pyside2.
  • Change and control object states.

Required Files

GitHUB Page

  • Group Manager script (group_manager.py)

Steps to Take

  1. Open a scene in iClone, preferably a scene with many items.
  2. Load the Group Manager python script (Group Manager.py) into the project (Script > Load Python > ...).
  3. In the subsequent Group Manger window, experiment with organizing the scene elements by following the instructions within the panel.

Musical keyboard

Musical Keyboard

Musical keyboard is a demonstration of creating key-press events that can respond in real-time making for an interactive user experience that can control elements in the scene. Once the script is initiated, a dialog window will appear with all the available keys mapped out. One can press on the corresponding keyboard letter and hear the note being played while the keyboard responds in kind. The sample scene file (Keyboard.iProject) also contains a prerecording in the form of a animation track (example: Timeline > Key_C > Transform/Sound).

You Will Learn how to

  • Use hot key to control props and emit sounds.

Required Files

GitHUB Page

  • iClone scene containing the keyboard prop (Keyboard.iProject)
  • Keyboard Python script (main.py)
  • Various WAV files containing individual key note sounds (wav folder).

Steps to Take

  1. Open the scene file provided in this section (Keyboard.iProject).
  2. Make the wav folder resides in the same directory as the python script (main.py).
  3. Press the keys: [C], [D], [E], [F], [G], [A], [B] and watch as the keyboard keys begin to press and produce unique notes.
  4. On the other hand, you can simply play the timeline to watch a pre-recording.