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
# 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'
FileOpen.Caption = "Select the animation to Retarget"
FileOpen.Style = FBFilePopupStyle.kFBFilePopupOpen

def calc(dist, frames):
    # Calculate the distance in 30 frames per second
    sec = float(frames / 30)
    m = float(dist / 100)

    return abs(float(m / sec))


# Grab a reference to the Scene
scene = FBSystem().Scene

# Create a list and populate it with the selected objects
models = FBModelList()
FBGetSelectedModels(models)

# Check if any objects are selected
if len(models) == 0:
    FBMessageBox("Model Selection Error:",
                 "No selected models found\n Select a model and try again!",
                 "Ok")
else:

    key_list = []
    # Get access to the X,Y,Z translation node keys
    for model in models:
        translationNode = model.Translation.GetAnimationNode()
        if has_keys_check(translationNode):
            for animNode in translationNode.Nodes:
                key_list.append(animNode)