def getSelectedOrder():
    # selectionOrder selection order:セレクトオーダー
    # Get the current selection
    lModelList = FBModelList()
    pParent = None
    pSelected = True
    pSortSelectedOrder = True
    FBGetSelectedModels(lModelList, pParent, pSelected, pSortSelectedOrder)

    if not lModelList:
        return None
    else:
        return lModelList
Esempio n. 2
0
# *- coding: utf-8 -*- #UTF8宣言使えばMB内でも日本語使える
from pyfbsdk import FBConstraintManager, FBModelList, FBGetSelectedModels

Models = FBModelList()
FBGetSelectedModels(Models)

for Model in Models:
    print(Model.PropertyList.Find("Lcl Rotation").Data)  # Lcl Rotation
    print(
        Model.PropertyList.Find("RotationActive").Data)  # Enable Rotation DOF
    print(Model.PropertyList.Find("RotationOrder").Data)  # Rotation Order
    print(Model.PropertyList.Find("PreRotation").Data)  # Pre Rotation

print("終わり")
Esempio n. 3
0
def UnselAll():
		selModels = FBModelList()
		FBGetSelectedModels (selModels, None, True)
		for model in selModels:
				model.Selected = False;
		del(selModels)
Esempio n. 4
0
		del (manager, Char)
		
# Unselect all function
def UnselAll():
		selModels = FBModelList()
		FBGetSelectedModels (selModels, None, True)
		for model in selModels:
				model.Selected = False;
		del(selModels)
		
# For the purpose of being able to clean up the file later on, we need to have
# all of the objects in the scene which need to stay there, be held in memory

UnselAll()

StartList = FBModelList()
StartListNames = list()
FBGetSelectedModels (StartList, None, False)
for model in StartList:
                StartListNames.append(model.Name)

# Now we need to assign animation plot options

pOpt = FBPlotOptions()
pOpt.UseConstantKeyReducer = False
pOpt.PlotAllTakes = True

#Filter needs to be set, otherwise it will crash

FileOpen = FBFilePopup()
FileOpen.Filter = '*.fbx'
Esempio n. 5
0
# *- coding: utf-8 -*- #UTF8宣言使えば日本語使える
from pyfbsdk import FBConstraintManager, FBModelList, FBGetSelectedModels

Models = FBModelList()
FBGetSelectedModels(Models)
OtherThanEulerXYZs = FBModelList()
count = 0

print("----- DOF Disable 処理開始 -----\n")

for Model in Models:
    print(count)
    print("Model Name = " + Model.Name)  # Model Name
    if Model.Rotation.GetAnimationNode() is None:  # アニメーションが無い
        RotDOF = Model.PropertyList.Find(
            "RotationActive")  # Enable Rotation DOF
        if RotDOF.Data is True:
            RotOrder = Model.PropertyList.Find(
                "RotationOrder")  # Enable Rotation DOF
            if RotOrder.Data == 0:
                LclRot = Model.PropertyList.Find(
                    "Lcl Rotation")  # Lcl Rotation
                print("Lcl Rotation = " + str(LclRot.Data))
                PreRot = Model.PropertyList.Find("PreRotation")  # PreRotation
                print("Pre Rotation = " + str(PreRot.Data))
                print("LclRotationを更新、DOFを無効化します")
                AddRot = LclRot.Data + PreRot.Data  # ただの足し算、、、バグったらたぶんここ
                LclRot.Data = AddRot
                print("Lcl Rotation = " + str(LclRot.Data))
                RotDOF.Data = False
                print("Enable Rotation DOF = " + str(RotDOF.Data))