IC Python API:Light Remote Control
Main article: RL Python Samples.
Light Remote Control
This lesson demonstrates the implementation of IOT doctrine (Internet of Things) to drive functions within the iClone application itself. Not only does this extend upon the functionalities available inside iClone, but it also where the medium of control is performed. Once the script is initiated in iClone and the unity scene is playing, the two applications will sync over the internet via the TCP/IP protocol. In which case, the iClone scene will send relevant light data to the Unity application. Once received, the Unity application will list out all of the light prop data received and create on/off toggle buttons and strength sliders for each light. When the controls are manipulated in the Unity application, data will be sent back into iClone to drive the same light parameters. For all this to work, the two applications must use the same network and the IP address displayed must match. Before you begin this lesson, make sure to download and install a copy of Unity 3D: https://unity3d.com/ as one of the lesson files requires it.
You Will Learn how to
- Use TCP/IP to connect iClone and other web apps.
- Control light props.
- Unity project for the remote control mobile application (Unity Project / iCloneRemoteControlLight folder)
- Light gizmo icons and user interface markup language file for QT (resource folder)
- Light Remote Control Python script -included in python sample (main.py)
Steps to Take
- Open or create a scene in iClone and pepper it with light props.
- Initiate the Light Remote Control script (Plugins > Python Samples > Light Remote Control).
- Take note of the IP address shown in the subsequent dialog window and open the SampleScene in Unity (Unity Project / iCloneRemoteControlLight / Assets / Scenes / SampleScene.unity).
- Once the project is loaded in Unity, press the play button above the "Game" panel to start the application.
- Make sure the IP address corresponds correctly with the IP address shown on the Light Remote Control APP.
- If the IP address do not match because you are using separate devices, make sure both are connected to the same internet network.
- Experiment around with the light sliders and watch as the lights in the scene begin to change as you pull on the slider bars and toggle them on and off.