Difference between revisions of "IC Python API:Uses and Capabilities"

From Reallusion Wiki!
Jump to: navigation, search
m (Version 0.7.1)
m (Version 0.7.3)
Line 230: Line 230:
 
</div></div>
 
</div></div>
  
=== Version 0.7.3 ===
+
=== Version 0.7.4 ===
  
 
<div class="toccolours mw-collapsible mw-collapsed" style="overflow:auto;">
 
<div class="toccolours mw-collapsible mw-collapsed" style="overflow:auto;">
<div style="font-weight:bold;line-height:1.6;">iC 7.4x Open Change Log: 03/03/2019 - 04/29/2019 </div>
+
<div style="font-weight:bold;line-height:1.6;">iClone 7.5 Open Change Log: 04/08/2019 - 07/01/2019 </div>
 
<div class="mw-collapsible-content">
 
<div class="mw-collapsible-content">
 
{|class= "wikitable"
 
{|class= "wikitable"
!scope="row"|RO::EHikEffector
+
!scope="row"|RO::RCameraDofData* CCameraObject::GetDOFData()
|Provide the same number as the core Hik enumeration that is aligned with RLHumanIK \ RLHikDef.h (the old version was aligned to ICInterfaceEnumDef.h).  This fix is applied to both LeftHandThumb and RightFootExtraFinger enums.
+
|Get Camera Dof data.
 
|-
 
|-
!scope="row"|RO::EHikEffectorType enum(Translate/Rotate)
+
!scope="row"|RO::RICameraPtr RScene::GetCurrentCamera()
|Provide settings for HIK effector translate / rotate.
+
|Get the camera currently used by the current IC.
 
|-
 
|-
!scope="row"|RMatrix4 RINode::WorldToLocal( RMatrix4 kWorld )
+
!scope="row"|RO::RStatus RGlobal::GetScreenSize( int& nWidth, int& nHeight )
|Used to convert the input world space matrix into a local space matrix relative to this node.
+
|Get Export Render size.
 
|-
 
|-
!scope="row"|RMatrix4 RINode::LocalToWorld( RMatrix4 kWorld )
+
!scope="row"|RIObject::SetName History
|Used to convert the input local space matrix into a matrix in actual wolrd space.
+
|SetName will now be recorded into undo/redo history.
 
|-
 
|-
!scope="row"|Modified RISkeletonComponent::GetSkinBones
+
!scope="row"|RO::RStatus RScene::ClearSelectObjects()
|Fixed the problem of not returning all the skin bones.  The original method will only have 54 Bone (CC), but it should be more than this.
+
|Added the state of deselecting objects in the scene.
 
|-
 
|-
!scope="row"|Modified RIProp::WorldTransform()
+
!scope="row"|float CCameraObject::GetAngleOfView( RO::RTime kTime ) const
|Fixed the faulty rotation problem.  The original Rotation did not do Degree to Radian, which caused the calculated Quaterion to be wrong.
+
|Get Iclone camera FOV.
 
|-
 
|-
!scope="row"|CHikEffectorComponent::SetActive( args... )
+
!scope="row"|RO::RStatus CCameraObject::GetAperture( float& fWidth, float& fHeight )
|Used to set HIK effector active state.  Usage: CHikEffectorComponent::SetActive( RO::EHikEffector eEffector, RO::EHikEffectorType eType, bool bActive ).
+
|Get Filmback width and height.
 
|-
 
|-
!scope="row"|CHikEffectorComponent::GetActive( args... )
+
!scope="row"|Modify RIVisemeComponent::AddVisemeKey( RVisemeKey )
|Used to get the current HIK effector active state.  Usage: CHikEffectorComponent::GetActive( RO::EHikEffector eEffector, RO::EHikEffectorType eType ).
+
|Pass in RVisemeKey instead.
 
|-
 
|-
!scope="row"|std::map< std::wstring, RL::CMatrix4f > CHikEffectorComponent::Solve( args... )
+
!scope="row"|Modify RIVisemeComponent::RemoveVisemesKey( RVisemeKey )
|Mocap solution for HIK.  Usage: RL::CMatrix4f > CHikEffectorComponent::Solve( RO::EHikEffector eEffector, const RL::CMatrix4f& kMatrix ).
+
|Pass in RVisemeKey instead.
 
|-
 
|-
!scope="row"|CHikEffectorComponent::SetLock( args... )
+
!scope="row"|Modify RIVisemeComponent::GetVisemeKey( RTime kTime, RVisemeKey& kKey )
|Used to set IK effector Lock. CHikEffectorComponent::SetLock( RO::EHikEffector eEffector, RO::EHikEffectorType eType, bool bLock ).
+
|Pass in RVisemeKey and Reference to retrieve data.
 
|-
 
|-
!scope="row"|CHikEffectorComponent::GetLock( args... )
+
!scope="row"|Modify RIVisemeComponent::GetVisemeKeys()
|Used to get the current IK effector Lock status.  Usage: CHikEffectorComponent::GetLock( RO::EHikEffector eEffector, RO::EHikEffectorType eType ).
+
|Directly return std :: vector <RVisemeKey>.
 
|-
 
|-
!scope="row"|CHikEffectorComponent::SetPosition( args... )
+
!scope="row"|Modify RIAvatar::GetGeneration
|Used to set IK effector Position coordinates. Usage: CHikEffectorComponent::SetPosition( RO::EHikEffector eEffector, const RL::CVector3f& vPosition ).
+
|Added two types CC_Game_Base_One & CC_Game_Base_Multi.
 
|-
 
|-
!scope="row"|CHikEffectorComponent::SetPosition( args... )
+
!scope="row"|Modify RFileIO::ExportFbxFile
|Used to set multiple IK effector Position coordinates. Usage: CHikEffectorComponent::SetPosition( const std::vector< RO::EHikEffector >& kEffectorIds, const std::vector< RL::CMatrix4f >& kEffectorWorld, const std::vector< bool >& kRotateActive, const std::vector< bool >& kTranslateActive).
+
|Take one more parameter std :: wstring strIncludeMotionPath to output together with Object.
 
|-
 
|-
!scope="row"|CHikEffectorComponent::SetBodyWeight( const float fWeight )
+
!scope="row"|bool RGlobal::IsTrialContentMode()
|It is used to set the weight ratio of whole body ik when IK effector moves (0-1).
+
|Added judging whether the current AP is loaded with trial content (for internal API).
 
|-
 
|-
!scope="row"|CVisemeComponent::TextToSpeech( args... )
+
!scope="row"|RISkeletonComponent::ConvertBoneAxisAndParent(kAxisMaps, kReParentMaps)
|Used to turn text into sound and set Viseme lips at the same time.  Usage: CVisemeComponent::TextToSpeech( std::wstring strContent, RO::ELanguage eLanguage, float fVolume, float fPitch, float fSpeed ).
+
|Calculate the current RTS according to the incoming axial map & change the parent's map.
 
|-
 
|-
!scope="row"|CVisemeComponent::TextToVisemeData( args... )
+
!scope="row"|RO::ECameraFitResolution CCameraObject::GetFitRenderRegionType()
|Used to convert input text into Visme lip data (English TTS system).  Usage: CVisemeComponent::TextToVisemeData( std::wstring strContent, float fVolume, float fPitch, float fSpeed ).
+
|Get Camera fit render region type (Horizontal / Vertical).
 
|-
 
|-
!scope="row"|Modify std::vector< RTime > GetVisemeKeyTimes()
+
!scope="row"|RO::ECameraFitResolution CCameraObject::GetFitFovType()
|Fixed the key time conversion problem.  Originally did not convert Frequency and changed GetVisemeKeys to GetVisemeKeyTimes.
+
|Get Camera fit fov type (Horizontal / Vertical).
 
|-
 
|-
!scope="row"|Modify CVisemeComponent::ProcessTTS( args... )
+
!scope="row"|void REventCallback::OnObjectDataChangedWithType( int nObjectChangeDataType )
|private function Modify the language system to determine the system according to RO :: ELanguage.  Usage: CVisemeComponent::ProcessTTS( std::wstring strContent, RO::ELanguage eLanguage, float fVolume, float fPitch, float fSpeed, std::wstring& wsWaveFilePath, RL::CArrayList< std::pair< unsigned short, unsigned int > >& kPhonemeDatas ).
+
|Added the type corresponding to the event when the AP triggers the ObjectDataChanged event.
 
|-
 
|-
!scope="row"|RAudio.Load
+
!scope="row"|void REventCallback::OnHierarchyChanged()
|Fixed issues with wave files crashing twice.
+
|Added AP to trigger HierarchyChanged event, currently occurs in reach effector.
 
|-
 
|-
!scope="row"|RFileIO::ExportFbxFile
+
!scope="row"|RIAvatar::GetAvatarType
|Used for exporting FBX files.
+
|Which Type is used to get the current character (Standard, NonStd, StandardSearize).
 
|-
 
|-
!scope="row"|API Versioning
+
!scope="row"|bool RFileIO::CheckExportFbxHasLicense( RO::RIObjectPtr spObject )
|Changed API version to 0.7.3 from 0.7.2.
+
|Added judging whether the output Fbx comes with a sell / export license (for internal API).
 
|-
 
|-
!scope="row"|RISkeletonComponent::GetRootPositionRetargetingRatio
+
!scope="row"|Modify RFileIO::ExportFbxFile
|Provides how to convert from Position of SkinRoot to Position of MotionRoot.
+
|When exporting Fbx, judge whether it has a sell / export license
 
|-
 
|-
!scope="row"|Modify ICCameraObject  - preview camera
+
!scope="row"|RISkeletonComponent::ConvertToOriginalBoneAxis()
|You can get preview camera through find camera object.
+
|Turn the current Pose into the axis of the original skeleton (NonStd characters only).
 
|-
 
|-
!scope="row"|CFaceComponent::GetWeight( args... )
+
!scope="row"|Modify RICCamera::GetFocalLength
|Get the clip and layer overlay result of the current facial expression.  Usage: CFaceComponent::GetWeight(RO::RTime kTime,std::vector< float >& kHead,std::vector< float >& kLeftEye,std::vector< float >& kRightEye,std::vector< float >& kMorph,std::vector< float >& kBone,std::vector< float >& kCustom,float& fStrength).
+
|Correction If it is judged that the control (CameraFovClipControl / CCameraFovKeyControl) is wrong, the focal length is calculated based on the FrustumFov in the current camera.
 
|-
 
|-
!scope="row"|RIAvatar::GetGeneration()
+
!scope="row"|RGlobal.TrialVersionRemainingTimes( args... )
|Provides CC roles belonging to CC_G1 or CC_G3.
+
|Can check the remaining number of trails (some Trial will be useful, ex 3DX). Usage: RGlobal.TrialVersionRemainingTimes( const std::wstring& strBinPath, unsigned int uProductID, const std::wstring& strProductFold,const std::wstring& strRegRoot,unsigned int uTimeNo )
|-
+
!scope="row"|eunm EAvatarGeneration{ CC_G1_Avatar, CC_G3_Avatar }
+
|Provides the CC character type.
+
|-
+
!scope="row"|Modify RISpotLight::SetSpotLightBeam( args... )
+
|Fixed the original misused fFalloffPower parameter, and the angle / falloff / attenuation is currently corresponding to GetSpotLightBeam. RISpotLight::SetSpotLightBeam( RTime kTime, float fAngle, float fFalloff, float fAttenuation ).
+
|-
+
!scope="row"|Modify RISpotLight::GetSpotLightBeam( args... )
+
|Modify the attenuation parameter value of the spotlight.  Usage: RISpotLight::GetSpotLightBeam( int& nAngle, int& nFalloff, int& nAttenuation ).
+
 
|}
 
|}
 
</div></div>
 
</div></div>

Revision as of 19:42, 25 December 2019

Main article: iClone Python API.

The iClone Python API helps you to extend and customize iClone, and more easily integrate it into a Python-based pipeline. It provides a bridge between iClone and Python libraries and Python tools. The Python SDK is built on top of the iClone C++ SDK, and you can access a subset of the iClone API from Python scripts and execute them in iClone.

The iClone Python API can do the following:

Character Prop Camera Light
Std(G5, CC, etc.) Non-Std Non-Human
Transformation (RTS) 7.4 7.4 7.4 7.4 7.4 7.4
Facial Expression 7.4 Mo-cap Module 7.4 Mo-cap Module - - - -
Morph Animation 7.4 Experimental 7.4 Experimental 7.4 Experimental 7.4 Experimental -
Material 7.4 Experimental 7.4 Experimental 7.4 Experimental 7.4 Experimental 7.4 Experimental
Parameters - - - - 7.4 Experimental 7.4 Experimental

Capabilities

As the iClone Python API continues to evolve, additional capabilities will be added over time. Below are lists of iClone Python API's current capabilities categorized by version number. The lists below are by no means exhaustive.

Version 0.7

[Expand]
iC 7.4x Open Change Log

Version 0.7.1

[Expand]
iC 7.4x Open Change Log: 01/17/2019 - 01/31/2019

Version 0.7.2

[Expand]
iC 7.4x Open Change Log: 02/15/2019 - 02/27/2019

Version 0.7.4

[Expand]
iClone 7.5 Open Change Log: 04/08/2019 - 07/01/2019

Limitations

As the iClone Python API continues to evolve, limitations may expand or contract over time. Below are lists of iClone Python API's currently known limitations. This list is not exhaustive.

Inoperable Assets

The following items can not be manipulated and acted upon with Python scripting:

  • Particle FX (iClone & PopcornFX)
  • SpeedTrees
  • Substance Materials
  • Textures Images
  • Constraints: Path, Spring, LookAt, Link, Physics, etc.
  • Physics (Soft & Rigid)
  • IK end-effectors (control attached props instead to drive IK reach)
  • Mesh level components: vertices, edges, faces, etc.
  • Preview camera

Unsupported Operations

The following operations are not available via Python scripting:

  • Saving iClone formats: iProjects, iAvatars, iProps, etc.
  • Pixel operations: multiply, add, overlay, etc.
  • Image processing: Brightness, Hue, Saturation, Sharpen, Soften, Blend, etc.
  • Render parameter settings (Project settings can not be changed)
  • Facial lip-sync keying
  • Preference settings
  • Attach/Detach: changing object parent-child relation
  • Align motion/character root alignment
  • Modeling operations: manipulation of mesh components