特定のオブジェクトのリスト内で、共通の親であるモデルを取得します。
oReturn = SIGetModel( InputObjs ); |
特定のオブジェクトを含むモデルを戻します。 InputObj に種類の異なるモデルが含まれている場合は、すべてのモデルを含むモデル階層内のモデルが戻されます(例: Scene_Root)。
'--------------------------------------------------------- ' VBScript example : Getting model parents. This script ' demonstrates how to use the SIGetModel to find the common parent ' model of a given group of models. '--------------------------------------------------------- ' First, create some models in a heirarcy. SICreateModel , "Sub1" SICreateModel , "Sub2" SICreateModel , "Sub2_2" SICreateModel "Sub1", "Root1" SICreateModel "Sub2, Sub2_2", "Root2" ' Now try to get the parent models of some models of models. Contains_Sub1 = SIGetModel("Sub1") logmessage Contains_Sub1 & " contains Sub1." Contains_Sub2 = SIGetModel("Sub2") logmessage Contains_Sub2 & " contains Sub2." Contains_Root1 = SIGetModel("Root1") logmessage Contains_Root1 & " contains Root1." ' Now try some with groups of models. Contains_Sub2_Sub2_2 = SIGetModel("Sub2, Sub2_2") logmessage Contains_Sub2_Sub2_2 & " contains Sub2 and Sub2_2." Contains_Sub1_Sub2 = SIGetModel("Sub1, Sub2") logmessage Contains_Sub1_Sub2 & " contains Sub1 and Sub2" Contains_Root1_Root2 = SIGetModel("Root1, Root2") logmessage Contains_Root1_Root2 & " contains Root1 and Root2" '--------------------------------------------------------- ' Output from the script: ' Object : "Root1" ' Object : "Root1.Sub1" ' Object : "Root2" ' Object : "Root2.Sub2" ' Object : "Root2.Sub2_2" 'INFO : "Root1 contains Sub1." 'INFO : "Root2 contains Sub2." 'INFO : "Scene_Root contains Root1." 'INFO : "Root2 contains Sub2 and Sub2_2." 'INFO : "Scene_Root contains Sub1 and Sub2" 'INFO : "Scene_Root contains Root1 and Root2" '--------------------------------------------------------- |