v12.0 (2014)
プロット ファイルにより、オブジェクトが Camera Sequencer 時間の新しいキャッシュ ファイルにキャッシュされました。
oArray = PlotCamSeqForCachedObjects( [Path], [SequencerIn], [SequencerOut], [PlotWithoutGaps], [Attributes], [UseGlobalKine] ); |
| パラメータ | タイプ | 説明 |
|---|---|---|
| Path | 文字列 | プロットされたキャッシュ ファイルを配置するターゲット パス。ファイル名には "_#" トークンを含める必要があります。 |
| SequencerIn | Long |
プロットする Camera Sequencer フレームを開始します。 デフォルト値: 1 |
| SequencerOut | Long |
プロットする Camera Sequencer フレームを終了します。 デフォルト値: 100 |
| PlotWithoutGaps | Boolean |
ShotClips 間のギャップを無視するかどうかを決定します。 デフォルト値: False |
| Attributes | 文字列 | 含める属性の一覧。指定しない場合は、すべての属性がプロットされます。 |
| UseGlobalKine | Boolean |
true の場合は、グローバル空間でプロットします。 デフォルト値: False |
"""
The sample code demonstrates how to construction a camera sequencer shot with cached ICE simulations
"""
# 1) Create a basic emission from grid and cache the ICE simulation to file
Application.NewScene( "", False )
Application.CreatePrim("Grid", "MeshSurface", "", "")
Application.ICEFlow_CreateParticles("", "", "")
Application.CacheObjectsIntoFile( "pointcloud", 5, 1, 100, 1, True, True,
"Color,Force,Mass,NbSubSamples,Orientation,PointPosition,PointVelocity,Scale,Shape,SimulatedFrameFraction,Size,State_ID",
"ICECache1",
XSIUtils.BuildPath( "[project path]", "Simulation", "[model]", "[object]", "[object]_ICECache1_#.icecache" ),
False )
# 2) Create a new point cloud and apply the cached simulation
Application.NewScene( "", False )
Application.GetPrim( "pointcloud", "ice_cached_cloud" )
Application.AddFileCacheSource( "ice_cached_cloud",
XSIUtils.BuildPath( "[project path]", "Simulation", "scene_root", "pointcloud", "pointcloud_ICECache1_[1..100].icecache" ),
"", "" )
# 3) Create Camera Sequencer Shot Clips
Application.AddShotClip( "", "Shot1", "", 1, 80, 99 )
Application.AddShotClip( "", "Shot2", "", 25, 1, 31 )
Application.AddShotClip( "", "Shot3", "", 60, 80, 99 )
Application.SceneRefresh()
# 4) Plot the cached ICE simulation in the Camera Sequencer
RetVal = Application.PlotCamSeqForCachedObjects( XSIUtils.BuildPath( "[project path]", "Simulation", "CamSeq", "ice_cached_cloud_CamSeqCache_#.icecache" ),
1, 100, "", "", False )
Application.LogMessage( "Name of cached cloud: " + RetVal[0] )
Application.LogMessage( "Location of cache files: " + RetVal[1] )
Application.LogMessage( "Collection of clips to be deleted: " + RetVal[2].GetAsText() )
# 5) Re-apply plotted cache simulation back to the pointcloud
Application.ApplyCamSeqFileCacheSources( RetVal[0], RetVal[1], RetVal[2] ) |