v6.0
オブジェクトのジオメトリが含まれる Geometry オブジェクトが戻されます。
注: このメソッドは Python で無効なオブジェクトを戻す可能性があります。代わりに Primitive.GetGeometry3 を使用してください。
Geometry Primitive.GetGeometry2( Object, siConstructionMode in_mode ); |
oReturn = Primitive.GetGeometry2( [Time], [Mode] ); |
| パラメータ | タイプ | 説明 |
|---|---|---|
| Time | Double |
プロパティを取得する時間(フレーム) 注:この引数は、オペレータの内部では無視されます。 デフォルト値:現在の時間(フレーム) |
| Mode | siConstructionMode |
コンストラクションモードは、特定のデフォームを使用したジオメトリのバージョンにアクセスするのに使用されます。取得するジオメトリの位置は、渡したモードに応じて異なります。デフォルトでは、この引数は siConstructionModeSecondaryShape に設定されます。これは、シェイプを含むジオメトリ、エンベロープデフォーメーション、移動ポイントオペレータとしてエンベロープの上にインストールされるデフォームを組み合わせるものです。通常このモードは、シェイプとエンベロープデフォーメーションの最終結果をプロットするために使用されます。 他の重要なモード: siConstructionModeModeling: ジオメトリの元の位置を取得します。通常このモードは、ジオメトリ、シェイプ、エンベロープの位置を別々に書き出す書き出しアプリケーションで使用されます。 siConstructionModePrimaryShape:ジオメトリの位置とシェイプデフォーメーションを組み合わせます。 siConstructionModeAnimation:ジオメトリの位置とシェイプおよびエンベロープデフォーメーションをすべて組み合わせます。 siConstructionModeDefault:Softimage に設定される現在のコンストラクションモードが使用されます。 注:この引数は、オペレータの内部では無視されます。 デフォルト値:siConstructionModeSecondaryShape |
#
# This example demontrates how to get position of a point at a specific time frame
#
# Import the constants
from win32com.client import constants as c
import sys, types
Application.NewScene("", 0)
oGrid = Application.ActiveSceneRoot.AddGeometry( "Grid", "MeshSurface" )
Application.SetValue (oGrid.Name + ".polymsh.geom.subdivu", 1)
Application.SetValue (oGrid.Name + ".polymsh.geom.subdivv", 1)
Application.Scale( oGrid, 0.25, 0.25, 0.25, c.siAbsolute, c.siParent, c.siObj, c.siXYZ)
startTimeInSeconds = 5 / 29.97
duration = startTimeInSeconds * 2
# Start at frame 5 && last 100 frames
oClip = oGrid.ActivePrimitive.Geometry.SaveShapeKey(
startTimeInSeconds,
duration,
c.siShapeAbsoluteReferenceMode,
c.siShapeInstanceOnlyMode,
"Clip", ( 0,1,2,3),
( -4,0,-4,
-4,0, 4,
4,0, 0,
4,0, 4 ))
# Frame 3 should be the original grid
oPoints = oGrid.ActivePrimitive.GetGeometry2(3,c.siConstructionModeSecondaryShape).Points
oPos = oPoints[2].Position
Application.LogMessage( "%f,%f,%f" % ( oPos.X,oPos.Y,oPos.Z ) )
# Frame 10 should the modified grid in the clip
oPoints = oGrid.ActivePrimitive.GetGeometry2(10).Points
oPos = oPoints[2].position
Application.LogMessage( "%f,%f,%f" % ( oPos.X,oPos.Y,oPos.Z ) )
# Expected results:
#INFO : 4.000000,0.000000,-4.000000
#INFO : 4.000000,0.000000,0.000000 |