Skip to content

Instantly share code, notes, and snippets.

@whaison
Last active February 7, 2017 13:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save whaison/aa5295e5da11d8a61bc771ae21db1d64 to your computer and use it in GitHub Desktop.
Save whaison/aa5295e5da11d8a61bc771ae21db1d64 to your computer and use it in GitHub Desktop.
# -*- coding: utf-8 -*-
from fbx import *
import DebugLogger00100
import WriteReadTrans_Z_00310
import GetKeyCurve00110
#===================class Node=========================
import FbxCommon
#===================class Node=========================
class Node() :
def __init__(self, name, parent) :
self.name = name
self.parent = parent
self.children = None
self.type = None
def addChild(self, child) :
if not self.children : self.children = list()
self.children.append(child)
def getTypeName(fbxNode) :
DebugLog("190 getTypeName(fbxNode= "+str(fbxNode) )
nodeAttr = fbxNode.GetNodeAttribute()
e = nodeAttr.GetAttributeType()
sType = "Unknown"
if FbxNodeAttribute.eNull == e : sType = "Null"
elif FbxNodeAttribute.eMarker == e : sType = "Marker"
elif FbxNodeAttribute.eSkeleton == e : sType = "Skeleton"
elif FbxNodeAttribute.eMesh == e : sType = "Mesh"
elif FbxNodeAttribute.eNurbs == e : sType = "Nurbs"
elif FbxNodeAttribute.ePatch == e : sType = "Patch"
elif FbxNodeAttribute.eCamera == e : sType = "Camera"
elif FbxNodeAttribute.eLight == e : sType = "Light"
return sType
def getHierarchy(fbxNode, node) :
num = fbxNode.GetChildCount()
DebugLog("205 getHierarchy(fbxNode= "+str(fbxNode)+", node.name= "+str(node.name)+")")
if 0 == num : return
for i in range(num) :
fbxChild = fbxNode.GetChild(i)
nodeChild = Node(fbxChild.GetName(), node)
nodeChild.type = getTypeName(fbxChild)
node.addChild(nodeChild)
getHierarchy(fbxChild, nodeChild)
import inspect
class FbxImport_WriteReadTrans_Z_00610() :
Yen="\\"
FileName= "FbxImport_WriteReadTrans_Z_00610__Log.csv"
#print("HD FULL PATH =")
#HD_FULL_PATH=os.path.abspath(__file__)
#print("os.path.abspath(__file__) = " + HD_FULL_PATH)
FullPass_DustDataTextFile_TXT= "D:"+Yen+"vs"+Yen+"py"+Yen+FileName
Yen="\\"
#IMPORT_FBX_FileName="Solder_Model_ASCII_2016_2017_motion00200.fbx"
IMPORT_FBX_FileName="walkTest_00200_Only_Root_And_C_Pelvis_ASCII.fbx"
IMPORT_FBX_FileName ="walkTest.fbx"
FBX_FILE_PATH_AND_NAME_AND_EXT= "D:"+Yen+"vs"+Yen+"py"+Yen+IMPORT_FBX_FileName
EXPORT_FBX_FILENAME="walkTest_00200_Only_Root_And_C_Pelvis_ASCII_Fbx_Trans_Z_00510_.fbx"
EXPORT_FBX_FILENAME="walkTest_Fbx_Trans_Z_00510_.fbx"
FullPass_EXPORT_FBX_FILENAME= "D:"+Yen+"vs"+Yen+"py"+Yen+EXPORT_FBX_FILENAME
#TransZwriteReader
# Propaty End========================================
# Method Start========================================
def FbxImport_WriteReadTrans_Z_00610(self):
print ("==========================FbxImport_WriteReadTrans_Z_00610()=========================================")
#DebugLog_init(FullPass_DustDataTextFile_TXT,"--------none--------"):
#DebugLog_init()
def loadFile(self, filename,TransZwriteReader,GetKeyCurve_Instance) :
self.ref_TransZwriteReader_instance=TransZwriteReader
#self.ref_TransZwriteReader_instance.ExportWrite( floatNumstr );
#self.ref_TransZwriteReader_instance.ExportWrite( 0.123456789 );
self.filename = filename
self.root = None
self.load()
def load(self) :
print ("loading ... self.filename= "+self.filename)
#print "loading : %s"%self.filename
manager = FbxManager.Create()
ios = FbxIOSettings.Create(manager, IOSROOT)
manager.SetIOSettings(ios)
importer = FbxImporter.Create(manager, "")
fbxImportSuccesBool=importer.Initialize(self.filename, -1, manager.GetIOSettings())
DebugLog("fbxImportSuccesBool="+str(fbxImportSuccesBool))
if not fbxImportSuccesBool:
print ("==============Failed to load file.=============="+self.filename)
return
scene = FbxScene.Create(manager, "MyScene")
importer.Import(scene)
#==========================================================
#importScene.py Timeing
#==========================================================
lScene =scene
lScene_GetGlobalSettings= lScene.GetGlobalSettings()
DebugLog("98 Frames FPS lScene_GetGlobalSettings = "+ str(lScene_GetGlobalSettings) )
DisplayGlobalTimeSettings(lScene.GetGlobalSettings())
#importer.Initialize()
fbxRoot = scene.GetRootNode()
self.root = Node(fbxRoot.GetName(), None)
getHierarchy(fbxRoot, self.root)
######GetMesh(self.root)
#GetKeyCurve(importer,scene)#198 200 Line
GetKeyCurve_Instance.GetKeyCurve(importer,scene)#198 200 Line
print ("==============Succeeded to load file.========="+self.filename)
DebugLog ("104 FbxImport_WriteReadTrans_Z_00610 def load() ==============Succeeded to load file.=========")
DebugLog ("104 FbxImport_WriteReadTrans_Z_00610 def load() ==============Succeeded to load file.=========")
DebugLog ("104 FbxImport_WriteReadTrans_Z_00610 def load() ==============Succeeded to load file.=========")
DebugLog ("104 FbxImport_WriteReadTrans_Z_00610 def load() ==============Succeeded to load file.=========")
DebugLog ("104 FbxImport_WriteReadTrans_Z_00610 def load() ==============Succeeded to load file.=========")
DebugLog ("104 FbxImport_WriteReadTrans_Z_00610 def load() ==============Succeeded to load file.=========")
DebugLog ("104 FbxImport_WriteReadTrans_Z_00610 def load() ==============Succeeded to load file.=========")
DebugLog ("#==========================================================================================================================")
DebugLog ("#113 FbxImport_WriteReadTrans_Z_00610 def load() Root_TransZ_AnimCurve_Kye_Value_List Loop ============================")
DebugLog ("#==========================================================================================================================")
self.Root_TransZ_AnimCurve_Kye_Value_List = GetKeyCurve_Instance.Root_TransZ_AnimCurve_Kye_Value_List
self.Root_TransZ_AnimCurve_Kye_Value_List_Count=len( self.Root_TransZ_AnimCurve_Kye_Value_List )
DebugLog ("#118 104 FbxImport_WriteReadTrans_Z_00610 def load() self.Root_TransZ_AnimCurve_Kye_Value_List_Count =_ "+str(self.Root_TransZ_AnimCurve_Kye_Value_List_Count)+"===")
self.ref_TransZwriteReader_instance.DebugLog("\n"+"Root_TransZ_AnimCurve_Kye_Value_List Loop "+str(self.Root_TransZ_AnimCurve_Kye_Value_List_Count)+"==="+"\n")
for R in range(0, self.Root_TransZ_AnimCurve_Kye_Value_List_Count):
lKeyValue= self.Root_TransZ_AnimCurve_Kye_Value_List[R]
DebugLog("self.Root_TransZ_AnimCurve_Kye_Value_List["+str(R)+"] = "+str(lKeyValue) )
self.ref_TransZwriteReader_instance.ExportWrite( str(lKeyValue) );
DebugLog ("#==========================================================================================================================")
DebugLog ("#113 FbxImport_WriteReadTrans_Z_00610 def load() _C_Pelvis_TransZ_AnimCurve_Kye_Value_List Loop ============================")
DebugLog ("#==========================================================================================================================")
self._C_Pelvis_TransZ_AnimCurve_Kye_Value_List = GetKeyCurve_Instance._C_Pelvis_TransZ_AnimCurve_Kye_Value_List
self._C_Pelvis_TransZ_AnimCurve_Kye_Value_List_Count=len( self._C_Pelvis_TransZ_AnimCurve_Kye_Value_List )
self.ref_TransZwriteReader_instance.DebugLog("\n"+" self._C_Pelvis_TransZ_AnimCurve_Kye_Value_List_Count =_ "+str(self._C_Pelvis_TransZ_AnimCurve_Kye_Value_List_Count)+"==="+"\n")
for C_Pelvis_N in range(0, self._C_Pelvis_TransZ_AnimCurve_Kye_Value_List_Count):
lKeyValue= self._C_Pelvis_TransZ_AnimCurve_Kye_Value_List[C_Pelvis_N]
DebugLog("self._C_Pelvis_TransZ_AnimCurve_Kye_Value_List["+str(C_Pelvis_N)+"] = "+str(lKeyValue) )
self.ref_TransZwriteReader_instance.ExportWrite( str(lKeyValue) );
DebugLog ("#118 104 FbxImport_WriteReadTrans_Z_00610 def load() self._C_Pelvis_TransZ_AnimCurve_Kye_Value_List_Count =_ "+str(self._C_Pelvis_TransZ_AnimCurve_Kye_Value_List_Count)+"===")
DebugLog ("#==========================================================================================================================")
DebugLog ("#113 FbxImport_WriteReadTrans_Z_00610 def load() self.R_virtual_Liner_List=R_virtual_Liner_List Loop ============================")
DebugLog ("#==========================================================================================================================")
self._C_Pelvis_TransZ_AnimCurve_Kye_Value_List = GetKeyCurve_Instance._C_Pelvis_TransZ_AnimCurve_Kye_Value_List
self._C_Pelvis_TransZ_AnimCurve_Kye_Value_List_Count=len( self._C_Pelvis_TransZ_AnimCurve_Kye_Value_List )
#self.ref_TransZwriteReader_instance.DebugLog("\n"+" self._C_Pelvis_TransZ_AnimCurve_Kye_Value_List_Count =_ "+str(self._C_Pelvis_TransZ_AnimCurve_Kye_Value_List_Count)+"==="+"\n")
DebugLog ("#118 104 FbxImport_WriteReadTrans_Z_00610 def load() self.Root_TransZ_AnimCurve_Kye_Value_List_Count =_ "+str(self.Root_TransZ_AnimCurve_Kye_Value_List_Count)+"===")
for C in range(0, self._C_Pelvis_TransZ_AnimCurve_Kye_Value_List_Count):
lKeyValue= self._C_Pelvis_TransZ_AnimCurve_Kye_Value_List[R]
DebugLog("self._C_Pelvis_TransZ_AnimCurve_Kye_Value_List["+str(R)+"] = "+str(lKeyValue) )
#self.ref_TransZwriteReader_instance.ExportWrite( str(lKeyValue) );
#======================================================
R_virtual_Liner_List=None
#==========================================
#==========================================
R_virtual_Liner_List = [0]
#指定のインデックスの要素を削除する
R_virtual_Liner_List.pop(0)
#----------------------------------------------
#======================================================
R_virtual_Liner_parcent_value_List=None
#==========================================
#==========================================
R_virtual_Liner_parcent_value_List = [0]
#指定のインデックスの要素を削除する
R_virtual_Liner_parcent_value_List.pop(0)
#----------------------------------------------
R_virtual_Liner_First_Float=self._C_Pelvis_TransZ_AnimCurve_Kye_Value_List[0]
R_virtual_Liner_ENDing_Float=self._C_Pelvis_TransZ_AnimCurve_Kye_Value_List[self._C_Pelvis_TransZ_AnimCurve_Kye_Value_List_Count-1]
self.ref_TransZwriteReader_instance.DebugLog("\n"+" R_virtual_Liner_List for incliment_value R_virtual_Liner_First_Float ="+str(R_virtual_Liner_First_Float)+"_"+"\n" )
self.ref_TransZwriteReader_instance.DebugLog("\n"+" R_virtual_Liner_List for incliment_value R_virtual_Liner_ENDing_Float ="+str(R_virtual_Liner_ENDing_Float)+"_"+"\n" )
R_virtual_Liner_Center_Float=(R_virtual_Liner_First_Float+R_virtual_Liner_ENDing_Float)*0.5
C_Pelvis_List_Count = self._C_Pelvis_TransZ_AnimCurve_Kye_Value_List_Count
# 0.5 is pearcen of position 0 ~ 1 = 0 ~ C_Pelvis_List_Count
# 0/C_Pelvis_List_Count 1/C_Pelvis_List_Count
#parcent_value= 1/C_Pelvis_List_Count
#===============================Sa>>>incliment_value
sa=R_virtual_Liner_ENDing_Float-R_virtual_Liner_First_Float
self.ref_TransZwriteReader_instance.DebugLog("\n"+" R_virtual_Liner_List for incliment_value sa ="+str(sa)+"_"+"\n" )
incliment_value = sa/ (self._C_Pelvis_TransZ_AnimCurve_Kye_Value_List_Count-1)
#self.ref_TransZwriteReader_instance.DebugLog("\n"+" R_virtual_Liner_List incliment_value="+str(incliment_value)+"\n")
#R_virtual_Liner_List.append(R_virtual_Liner_First_Float)
build_Value_Z=R_virtual_Liner_First_Float
#self.ref_TransZwriteReader_instance.ExportWrite( str(build_Value_Z) );
R_virtual_Liner_List.append(build_Value_Z)
for R_virturel in range(1,self._C_Pelvis_TransZ_AnimCurve_Kye_Value_List_Count-1):
build_Value_Z = build_Value_Z+incliment_value
R_virtual_Liner_List.append(build_Value_Z)
#self.ref_TransZwriteReader_instance.ExportWrite( str(build_Value_Z) );
build_Value_Z = R_virtual_Liner_ENDing_Float
R_virtual_Liner_List.append(build_Value_Z)
#self.ref_TransZwriteReader_instance.ExportWrite( str(build_Value_Z) );
self.R_virtual_Liner_List=R_virtual_Liner_List
#============================ D e b u g L o o p
R_virtual_Liner_List_Count=len(R_virtual_Liner_List)
self.ref_TransZwriteReader_instance.DebugLog("\n"+" R_virtual_Liner_List incliment_value="+str(incliment_value)+" R_virtual_Liner_List Conut= "+str(R_virtual_Liner_List_Count) +" leng"+"\n" )
R_virturel=0
for R_virturel in range(0,R_virtual_Liner_List_Count):
virturl_Zvalue=R_virtual_Liner_List[R_virturel]
self.ref_TransZwriteReader_instance.ExportWrite( str(virturl_Zvalue) );
#===============================Sa>>>incliment_value
DebugLog ("#==========================================================================================================================")
DebugLog ("#203 FbxImport_WriteReadTrans_Z_00610 def load() _C_Pelvis_Bake_Z_Line ============================")
DebugLog ("#==========================================================================================================================")
#======================================================
_C_Pelvis_Bake_Z_Line_List=None
#==========================================
#==========================================
_C_Pelvis_Bake_Z_Line_List = [0]
#指定のインデックスの要素を削除する
_C_Pelvis_Bake_Z_Line_List.pop(0)
_C_Pelvis_Bake_Z_Line_List.append(0)
#----------------------------------------------
for CP in range(1,self._C_Pelvis_TransZ_AnimCurve_Kye_Value_List_Count):
A = self.R_virtual_Liner_List[CP]
B= self._C_Pelvis_TransZ_AnimCurve_Kye_Value_List[CP]
sa=A-B
_C_Pelvis_Bake_Z_Line_List.append(sa)
#============================ D e b u g L o o p
_C_Pelvis_Bake_Z_Line_List_Count=len(_C_Pelvis_Bake_Z_Line_List)
self.ref_TransZwriteReader_instance.DebugLog("\n"+" _C_Pelvis_Bake_Z_Line_List Conut= "+str(_C_Pelvis_Bake_Z_Line_List_Count) +" leng"+"\n" )
R_virturel=0
for CPB in range(0,_C_Pelvis_Bake_Z_Line_List_Count):
bake_Zvalue=_C_Pelvis_Bake_Z_Line_List[CPB]
self.ref_TransZwriteReader_instance.ExportWrite( str(bake_Zvalue) );
self._C_Pelvis_Bake_Z_Line_List=_C_Pelvis_Bake_Z_Line_List
DebugLog ("#==========================================================================================================================")
DebugLog ("#========================================== AmimCurve Set Value ROOT=========================================================")
DebugLog ("#==========================================================================================================================")
#==========================================================================================================================
#=================================================== AmimCurve Set Value ========================================================
#==========================================================================================================================
# Step 1 Reset Zero Root Default -2.62056103542
#==========================================
self.Root_TransZ_AnimCurve_Kye_Value_List = GetKeyCurve_Instance.Root_TransZ_AnimCurve_Kye_Value_List
Root_TransZ_AnimCurve_Kye_Value_List_Count=len(self.Root_TransZ_AnimCurve_Kye_Value_List)
#============ Root Avarage =====================
Build_Root_Z_All_Value=0
for ave_Root_AnimCurve_Key_N in range(0,Root_TransZ_AnimCurve_Kye_Value_List_Count):
Build_Root_Z_All_Value = Build_Root_Z_All_Value+self.Root_TransZ_AnimCurve_Kye_Value_List[ave_Root_AnimCurve_Key_N]
Root_Z_average = Build_Root_Z_All_Value / Root_TransZ_AnimCurve_Kye_Value_List_Count
self.ref_TransZwriteReader_instance.DebugLog("\n\n\n"+" Root_Z_average= "+str(Root_Z_average) +" value Z"+"\n \n" )
self.Root_Z_average=Root_Z_average
####====================================================
strData_str=str(Root_Z_average)
e_infinity_str_first_to_end_count=strData_str.find("e")
new_float_string= strData_str
if e_infinity_str_first_to_end_count==-1:
new_float_string= strData_str
else:
new_float_string= strData_str[0:e_infinity_str_first_to_end_count]
#new_float_string= strData_str[0:4]
Root_Z_average_new_float= float(new_float_string)
self.ref_TransZwriteReader_instance.DebugLog("\n\n\n"+" Root Non E Un infinity Value Root_Z_average_new_float= "+str(Root_Z_average_new_float) +" value Z"+"\n \n" )
#===========================================================
#指定のインデックスの要素を削除する
_C_Pelvis_Bake_Z_Line_List.pop(0)
_C_Pelvis_Bake_Z_Line_List.append(0)
#----------------------------------------------
self.ref_C_Pelvis_TransZ_AnimCurve_List = GetKeyCurve_Instance.ref_Root_TransZ_AnimCurve_List
pCurveR=self.ref_C_Pelvis_TransZ_AnimCurve_List[0]
lKeyCountR = pCurveR.KeyGetCount()
DebugLog("lKeyCountR = _ "+str(lKeyCountR) +" _")
self.ref_TransZwriteReader_instance.DebugLog("\n"+" ROOT AmimCurve Set Value Keys= "+str(lKeyCountR) +" keys"+"\n \n" )
for set_Root_AnimCurve_Key_N in range(0,lKeyCountR):
lCountR=set_Root_AnimCurve_Key_N
lKeyValueR = pCurveR.KeyGetValue(lCountR)
self.ref_TransZwriteReader_instance.DebugLog( str(lKeyValueR) )
# def DisplayCurve_00100_KeysEdit_(self,pCurve):///////////////////////////////////////////////////////////////////////////////////////ROOT EDIT 1 One
for set_Root_AnimCurve_Key_N in range(0,lKeyCountR):
lCountR=set_Root_AnimCurve_Key_N
lKeyValueR = pCurveR.KeyGetValue(lCountR)
newSetValueR= 0
pCurveR.KeySetValue (lCountR,newSetValueR)
self.ref_TransZwriteReader_instance.DebugLog("\n"+" ROOT AmimCurve Setted Value Keys= "+str(lKeyCountR) +" keys"+"\n \n" )
for set_Root_AnimCurve_Key_N in range(0,lKeyCountR):
lCount=set_Root_AnimCurve_Key_N
lKeyValueR = pCurveR.KeyGetValue(lCountR)
self.ref_TransZwriteReader_instance.DebugLog( str(lKeyValueR) )
# def DisplayCurve_00100_KeysEdit_(self,pCurve):///////////////////////////////////////////////////////////////////////////////////////ROOT EDIT 2 TWO
for set_Root_AnimCurve_Key_N in range(0,lKeyCountR):
lCountR=set_Root_AnimCurve_Key_N
lKeyValueR = pCurveR.KeyGetValue(lCountR)
newSetValueR= 50
newSetValueR= self.R_virtual_Liner_List[lCountR]
pCurveR.KeySetValue (lCountR,newSetValueR)
self.ref_TransZwriteReader_instance.DebugLog("\n"+" ROOT AmimCurve Setted Value Keys= "+str(lKeyCountR) +" keys"+"\n \n" )
for set_Root_AnimCurve_Key_N in range(0,lKeyCountR):
lCount=set_Root_AnimCurve_Key_N
lKeyValueR = pCurveR.KeyGetValue(lCountR)
self.ref_TransZwriteReader_instance.DebugLog( str(lKeyValueR) )
DebugLog ("#==========================================================================================================================")
DebugLog ("#========================================== AmimCurve Set Value C_Pelvis =========================================================")
DebugLog ("#==========================================================================================================================")
#==========================================================================================================================
#=================================================== AmimCurve Set Value ========================================================
#==========================================================================================================================
# Step 1 Reset Zero Curve C_Pelvis
self.ref_C_Pelvis_TransZ_AnimCurve_List = GetKeyCurve_Instance.ref_C_Pelvis_TransZ_AnimCurve_List
#ref_C_Pelvis_TransZ_AnimCurve_List_Count=len(self.ref_C_Pelvis_TransZ_AnimCurve_List)
pCurve=self.ref_C_Pelvis_TransZ_AnimCurve_List[0]
lKeyCount = pCurve.KeyGetCount()
DebugLog("lKeyCount = _ "+str(lKeyCount) +" _")
self.ref_TransZwriteReader_instance.DebugLog("\n"+" C_Pelvis AmimCurve Set Value Keys= "+str(lKeyCount) +" keys"+"\n" )
for set_C_pelvis_AnimCurve_Key_N in range(0,lKeyCount):
lCount=set_C_pelvis_AnimCurve_Key_N
lKeyValue = pCurve.KeyGetValue(lCount)
self.ref_TransZwriteReader_instance.DebugLog( str(lKeyValue) )
#pointa_AnumCurve_C_Pelvis=self.ref_C_Pelvis_TransZ_AnimCurve_List[set_C_pelvis_AnimCurve_Key_N]
#DebugLog("pointa_AnumCurve_C_Pelvis = "+str(pointa_AnumCurve_C_Pelvis) +"_")
#pointa_AnumCurve_C_Pelvis.KeySetValue (set_C_pelvis_AnimCurve_N,0)
# def DisplayCurve_00100_KeysEdit_(self,pCurve)://///////////////////////////////////////////////////////////////////////////////////// C_Pelvis EDIT 1 One
for set_C_pelvis_AnimCurve_Key_N in range(0,lKeyCount):
lCount=set_C_pelvis_AnimCurve_Key_N
lKeyValue = pCurve.KeyGetValue(lCount)
newSetValue= 0
pCurve.KeySetValue (lCount,newSetValue)
#self.ref_TransZwriteReader_instance.DebugLog( str(lKeyValue) )
#pointa_AnumCurve_C_Pelvis=self.ref_C_Pelvis_TransZ_AnimCurve_List[set_C_pelvis_AnimCurve_Key_N]
#DebugLog("pointa_AnumCurve_C_Pelvis = "+str(pointa_AnumCurve_C_Pelvis) +"_")
#pointa_AnumCurve_C_Pelvis.KeySetValue (set_C_pelvis_AnimCurve_N,0)
self.ref_TransZwriteReader_instance.DebugLog("\n"+"C_Pelvis AmimCurve Setted Value Keys= "+str(lKeyCount) +" keys"+"\n" )
for set_C_pelvis_AnimCurve_Key_N in range(0,lKeyCount):
lCount=set_C_pelvis_AnimCurve_Key_N
lKeyValue = pCurve.KeyGetValue(lCount)
self.ref_TransZwriteReader_instance.DebugLog( str(lKeyValue) )
#pointa_AnumCurve_C_Pelvis=self.ref_C_Pelvis_TransZ_AnimCurve_List[set_C_pelvis_AnimCurve_Key_N]
#DebugLog("pointa_AnumCurve_C_Pelvis = "+str(pointa_AnumCurve_C_Pelvis) +"_")
#pointa_AnumCurve_C_Pelvis.KeySetValue (set_C_pelvis_AnimCurve_N,0)
# def DisplayCurve_00100_KeysEdit_(self,pCurve):////////////////////////////////////////////////////////////////////////////////////////// C_Pelvis EDIT 2 TWO
for set_C_pelvis_AnimCurve_Key_N in range(0,lKeyCount):
lCount=set_C_pelvis_AnimCurve_Key_N
lKeyValue = pCurve.KeyGetValue(lCount)
BakeValue =self._C_Pelvis_Bake_Z_Line_List[lCount]
newSetValue= BakeValue+self.Root_Z_average
pCurve.KeySetValue (lCount,newSetValue)
#self.ref_TransZwriteReader_instance.DebugLog( str(lKeyValue) )
#pointa_AnumCurve_C_Pelvis=self.ref_C_Pelvis_TransZ_AnimCurve_List[set_C_pelvis_AnimCurve_Key_N]
#DebugLog("pointa_AnumCurve_C_Pelvis = "+str(pointa_AnumCurve_C_Pelvis) +"_")
#pointa_AnumCurve_C_Pelvis.KeySetValue (set_C_pelvis_AnimCurve_N,0)
self.ref_TransZwriteReader_instance.DebugLog("\n"+" C_Pelvis AmimCurve Setted Value Keys= "+str(lKeyCount) +" keys"+"\n" )
for set_C_pelvis_AnimCurve_Key_N in range(0,lKeyCount):
lCount=set_C_pelvis_AnimCurve_Key_N
lKeyValue = pCurve.KeyGetValue(lCount)
self.ref_TransZwriteReader_instance.DebugLog( str(lKeyValue) )
#pointa_AnumCurve_C_Pelvis=self.ref_C_Pelvis_TransZ_AnimCurve_List[set_C_pelvis_AnimCurve_Key_N]
#DebugLog("pointa_AnumCurve_C_Pelvis = "+str(pointa_AnumCurve_C_Pelvis) +"_")
#pointa_AnumCurve_C_Pelvis.KeySetValue (set_C_pelvis_AnimCurve_N,0)
#==========================================================================================================================
#===================================================Save EXPORT F B X ======================================================== STA
#==========================================================================================================================
DebugLog ("#==========================================================================================================================")
DebugLog ("#========================================== Save EXPORT F B X ========================================================= STA")
DebugLog ("#==========================================================================================================================")
#==========================================================================================================================
#===================================================File Format F B X ======================================================== STA
#==========================================================================================================================
DebugLog ("#==========================================================================================================================")
DebugLog ("#========================================== File Format inspect getmembers ========================================================= STA")
DebugLog ("#==========================================================================================================================")
#// Try to fall back to SDK's native file format (an FBX binary file).
FbxImporter_Instance = importer # Class export instance.
#FbxAnimUtilities_Instance_Class_Method_List=FbxAnimUtilities_Instance.dir()
FbxImporter_Instance_Class_Method_List=inspect.getmembers(FbxImporter_Instance)
FbxImporter_Instance_Class_Method_List_long=len(FbxImporter_Instance_Class_Method_List)
DebugLog(" >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> FbxImporter_Instance_Class_Method_List_long ="+ str(FbxImporter_Instance_Class_Method_List_long)+" !!!!!!!!!!!!!!!!!!!!!<BR />!!!!!!!!!!!!!!!!!!!!!!!")
for classInt in range(0, FbxImporter_Instance_Class_Method_List_long):
classmember=FbxImporter_Instance_Class_Method_List[ classInt]
DebugLog(" >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> FbxImporter_Instance_ __ "+str(classInt)+" _ classmember ="+ str(classmember)+" !!!!!!!!!!!!!!!!!!!!!!!!!!!!!<BR />!!!!!!!!!!!!!!!")
DebugLog ("#==========================================================================================================================")
DebugLog ("#========================================== File Format F B X ========================================================= STA")
DebugLog ("#==========================================================================================================================")
DebugLog ("#==========================================================================================================================<BR />")
DebugLog ("#========================================== File Format FbxImporter_Instance inspect getmembers HTML ========================================================= STA<BR />")
DebugLog ("#==========================================================================================================================<BR />")
#// Try to fall back to SDK's native file format (an FBX binary file).
FbxImporter_Instance = importer # Class export instance.
#FbxAnimUtilities_Instance_Class_Method_List=FbxAnimUtilities_Instance.dir()
FbxImporter_Instance_Class_Method_List=inspect.getmembers(FbxImporter_Instance)
FbxImporter_Instance_Class_Method_List_long=len(FbxImporter_Instance_Class_Method_List)
DebugLog(" >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> FbxImporter Members Count ="+ str(FbxImporter_Instance_Class_Method_List_long)+" <BR /> ")
for classInt in range(0, FbxImporter_Instance_Class_Method_List_long):
classmember=FbxImporter_Instance_Class_Method_List[ classInt]
DebugLog(" "+str(classInt)+" _ <B>="+ str(classmember)+"</B> <BR /> ")
pFileFormat = importer.GetFileFormat()
# 23 _ =(\'FindDstObject\', )
# FbxObject = importer.FindDstObject(str)
# 24 _ =(\'FindDstProperty\', )
#FbxPropaty= importer.FindDstProperty(str)
# 25 _ =(\'FindProperty\', ) Creator: "FBX SDK/FBX Plugins version 2017.1"
FbxProperty_FindProperty_Creator_ = importer.FindProperty("Creator")
DebugLog("FbxProperty_FindProperty_Creator_" + str(FbxProperty_FindProperty_Creator_) )
FbxString_FbxProperty_FindProperty_Creator_= FbxProperty_FindProperty_Creator_.GetLabel;
DebugLog("FbxString_FbxProperty_FindProperty_Creator_" + str(FbxString_FbxProperty_FindProperty_Creator_) )
FbxObject_FbxProperty_FindProperty_Creator_= FbxProperty_FindProperty_Creator_.GetFbxObject;
DebugLog("FbxObject_FbxProperty_FindProperty_Creator_" + str(FbxObject_FbxProperty_FindProperty_Creator_) )
str_FbxObject_FbxProperty_FindProperty_Creator_= FbxObject_FbxProperty_FindProperty_Creator_.__str__;
DebugLog("str_FbxObject_FbxProperty_FindProperty_Creator_" + str(str_FbxObject_FbxProperty_FindProperty_Creator_) )
#==================================================== FBXVersion ================================================================
FbxProperty_FindProperty_FBXVersion_ = importer.FindProperty("FBXVersion")
DebugLog("FbxProperty_FindProperty_FBXVersion_" + str(FbxProperty_FindProperty_FBXVersion_) )
FbxString_FbxProperty_FindProperty_FBXVersion_= FbxProperty_FindProperty_FBXVersion_.GetLabel;
DebugLog("FbxString_FbxProperty_FindProperty_FBXVersion_" + str(FbxString_FbxProperty_FindProperty_FBXVersion_) )
FbxObject_FbxProperty_FindProperty_FBXVersion_= FbxProperty_FindProperty_Creator_.GetFbxObject;
DebugLog("FbxObject_FbxProperty_FindProperty_FBXVersion_" + str(FbxObject_FbxProperty_FindProperty_FBXVersion_) )
str_FbxObject_FbxProperty_FindProperty_FBXVersion_= FbxObject_FbxProperty_FindProperty_FBXVersion_.__str__;
DebugLog("str_FbxObject_FbxProperty_FindProperty_FBXVersion_" + str(str_FbxObject_FbxProperty_FindProperty_FBXVersion_) )
#=======================================================================================================================
# 26 _ =(\'FindPropertyHierarchical\', )
# 27 _ =(\'FindSrcObject\', )
# 28 _ =(\'FindSrcProperty\', )
# 29 _ =(\'GetActiveAnimStackName\', )
# 30 _ =(\'GetAllObjectFlags\', )
# 31 _ =(\'GetAnimStackCount\', )
# 32 _ =(\'GetClassId\', )
# 33 _ =(\'GetClassRootProperty\', )
# 34 _ =(\'GetDefaultRenderResolution\', )
# 35 _ =(\'GetDocument\', )
# 36 _ =(\'GetDstObject\', )
# 37 _ =(\'GetDstObjectCount\', )
# 38 _ =(\'GetDstProperty\', )
# 39 _ =(\'GetDstPropertyCount\', )
# 40 _ =(\'GetFileFormat\', )
int_FileFormat_= importer.GetFileFormat()
DebugLog("int_FileFormat_"+ str(int_FileFormat_) )
# 41 _ =(\'GetFileHeaderInfo\', )
FbxIOFileHeaderInfo_FileHeaderInfo_= importer.GetFileHeaderInfo()
DebugLog("FbxIOFileHeaderInfo_FileHeaderInfo_" + str(FbxIOFileHeaderInfo_FileHeaderInfo_) )
bool_HeaderInfo_ReadExtendedHeaderInformation_= FbxIOFileHeaderInfo_FileHeaderInfo_.ReadExtendedHeaderInformation
DebugLog("bool_HeaderInfo_ReadExtendedHeaderInformation_" + str(bool_HeaderInfo_ReadExtendedHeaderInformation_) )
DebugLog("============================ F B X F O R M A T V E R S I O N =================================================" )
DebugLog("============================ F B X F O R M A T V E R S I O N =================================================" )
DebugLog("============================ F B X F O R M A T V E R S I O N =================================================" )
DebugLog("============================ F B X F O R M A T V E R S I O N =================================================" )
FbxString_HeaderInfo_mCreator= FbxIOFileHeaderInfo_FileHeaderInfo_.mCreator
DebugLog("Maya Plugin FbxString_HeaderInfo_mCreator = " + str(FbxString_HeaderInfo_mCreator) )
FbxString_HeaderInfo_mFileVersion= FbxIOFileHeaderInfo_FileHeaderInfo_.mFileVersion
DebugLog("FbxString_HeaderInfo_mFileVersion = " + str(FbxString_HeaderInfo_mFileVersion) )
if FbxString_HeaderInfo_mFileVersion==6100:
DebugLog( "2006_2009_2010_FBX 6.1.0 project file" )
if FbxString_HeaderInfo_mFileVersion==7100:
DebugLog( "2011_FBX 7.1.0 project file" )
if FbxString_HeaderInfo_mFileVersion==7200:
DebugLog( "2012_FBX 7.2.0 project file" )
if FbxString_HeaderInfo_mFileVersion==7300:
DebugLog( "2013_FBX 7.3.0 project file" )
if FbxString_HeaderInfo_mFileVersion==7400:
DebugLog( "2014_2015_FBX 7.4.0 project file" )
if FbxString_HeaderInfo_mFileVersion==7500:
DebugLog( "2016_2017_FBX 7.5.0 project file" )
DebugLog("============================ F B X F O R M A T V E R S I O N =================================================" )
DebugLog("============================ F B X F O R M A T V E R S I O N =================================================" )
DebugLog("============================ F B X F O R M A T V E R S I O N =================================================" )
DebugLog("============================ F B X F O R M A T V E R S I O N =================================================" )
# 42 _ =(\'GetFileName\', )
FbxString_FileName_= importer.GetFileName()
# 43 _ =(\'GetFileVersion\', )
int3_FileVersion_ = importer.GetFileVersion()
# 44 _ =(\'GetFirstProperty\', )
FbxPropaty_First_ = importer.GetFirstProperty()
# 45 _ =(\'GetIOSettings\', )
FbxIOSettings_ = importer.GetIOSettings()
# 46 _ =(\'GetImportOptions\', )
bool_ImportOptions_ = importer.GetImportOptions()
# 47 _ =(\'GetInitialName\', )
str_InitialName_ = importer.GetInitialName()
# 48 _ =(\'GetName\', )
str_Name_ = importer.GetName()
# 49 _ =(\'GetNameOnly\', )
str_NameOnly_ = importer.GetNameOnly()
# 50 _ =(\'GetNameSpaceArray\', )
#list_NameSpaceArray_ = importer.GetNameSpaceArray()
# 51 _ =(\'GetNameSpaceOnly\', )
#FbxString_NameSpaceOnly_ = importer.GetNameSpaceOnly()
# 52 _ =(\'GetNameSpacePrefix\', )
#FbxString_NameSpacePrefix_ = importer.GetNameSpacePrefix()
# 53 _ =(\'GetNameWithNameSpacePrefix\', )
#FbxString_NameWithNameSpacePrefix_ = importer.GetNameWithNameSpacePrefix()
# 54 _ =(\'GetNameWithoutNameSpacePrefix\', )
#FbxString_NameWithoutNameSpacePrefix_ = importer.GetNameWithoutNameSpacePrefix()
# 55 _ =(\'GetNextProperty\', )
#FbxPropaty_NextProperty_ = importer.GetNextProperty()
# 56 _ =(\'GetObjectFlags\', )
# 57 _ =(\'GetReferenceTo\', )
# 58 _ =(\'GetReferencedBy\', )
# 59 _ =(\'GetReferencedByCount\', )
# 60 _ =(\'GetRootDocument\', )
# 61 _ =(\'GetScene\', )
# 62 _ =(\'GetSceneInfo\', )
# 63 _ =(\'GetSelected\', )
# 64 _ =(\'GetSrcObject\', )
# 65 _ =(\'GetSrcObjectCount\', )
# 66 _ =(\'GetSrcProperty\', )
# 67 _ =(\'GetSrcPropertyCount\', )
# 68 _ =(\'GetStatus\', )
# 69 _ =(\'GetTakeInfo\', )
# 70 _ =(\'GetTypeFlags\', )
# 71 _ =(\'GetTypeName\', )
# 72 _ =(\'GetUniqueID\', )
# 73 _ =(\'GetUrl\', )
# 74 _ =(\'Import\', )
# 75 _ =(\'Initialize\', )
# 76 _ =(\'IsAReferenceTo\', )
# 77 _ =(\'IsConnectedDstObject\', )
# 78 _ =(\'IsConnectedDstProperty\', )
# 79 _ =(\'IsConnectedSrcObject\', )
# 80 _ =(\'IsConnectedSrcProperty\', )
# 81 _ =(\'IsFBX\', )
# 82 _ =(\'IsImporting\', )
# 83 _ =(\'IsReferencedBy\', )
# 84 _ =(\'Localize\', )
# 85 _ =(\'RemovePrefix\', )
# 86 _ =(\'RootProperty\', )
DebugLog ("#==========================================================================================================================<BR /> ")
DebugLog ("#========================================== File Format F B X ========================================================= STA <BR /> ")
DebugLog ("#========================================================================================================================== <BR /> ")
DebugLog ("#==========================================================================================================================<BR />")
DebugLog ("#========================================== FbxIOPluginRegistry inspect getmembers HTML ========================================================= STA<BR />")
DebugLog ("#==========================================================================================================================<BR />")
#// Try to fall back to SDK's native file format (an FBX binary file).
FbxIOPluginRegistry_Instance = FbxIOPluginRegistry # Class export instance.
#FbxAnimUtilities_Instance_Class_Method_List=FbxAnimUtilities_Instance.dir()
FbxIOPluginRegistry_Instance_Class_Method_List=inspect.getmembers(FbxIOPluginRegistry_Instance)
FbxIOPluginRegistry_Instance_Class_Method_List_long=len(FbxIOPluginRegistry_Instance_Class_Method_List)
DebugLog(" >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> FbxIOPluginRegistry Members Count ="+ str(FbxIOPluginRegistry_Instance_Class_Method_List_long)+" <BR /> ")
for classInt in range(0, FbxImporter_Instance_Class_Method_List_long):
classmember=FbxImporter_Instance_Class_Method_List[ classInt]
DebugLog(" "+str(classInt)+" _ <B>="+ str(classmember)+"</B> <BR /> ")
pFileFormat = importer.GetFileFormat()
#29 _ =(\'GetActiveAnimStackName\', )
#30 _ =(\'GetAllObjectFlags\', )
#int_GetNativeReaderFormat= FbxIOPluginRegistry_Instance.GetNativeReaderFormat()
#31 _ =(\'GetAnimStackCount\', )
#32 _ =(\'GetClassId\', )
#33 _ =(\'GetClassRootProperty\', )
#34 _ =(\'GetDefaultRenderResolution\', )
#35 _ =(\'GetDocument\', )
#36 _ =(\'GetDstObject\', )
#37 _ =(\'GetDstObjectCount\', )
#38 _ =(\'GetDstProperty\', )
#39 _ =(\'GetDstPropertyCount\', )
#40 _ =(\'GetFileFormat\', )
#41 _ =(\'GetFileHeaderInfo\', )
#42 _ =(\'GetFileName\', )
#43 _ =(\'GetFileVersion\', )
#44 _ =(\'GetFirstProperty\', )
#45 _ =(\'GetIOSettings\', )
#46 _ =(\'GetImportOptions\', )
#47 _ =(\'GetInitialName\', )
#48 _ =(\'GetName\', )
#49 _ =(\'GetNameOnly\', )
#50 _ =(\'GetNameSpaceArray\', )
#51 _ =(\'GetNameSpaceOnly\', )
#52 _ =(\'GetNameSpacePrefix\', )
#53 _ =(\'GetNameWithNameSpacePrefix\', )
#54 _ =(\'GetNameWithoutNameSpacePrefix\', )
#55 _ =(\'GetNextProperty\', )
#56 _ =(\'GetObjectFlags\', )
#57 _ =(\'GetReferenceTo\', )
#58 _ =(\'GetReferencedBy\', )
#59 _ =(\'GetReferencedByCount\', )
#60 _ =(\'GetRootDocument\', )
#61 _ =(\'GetScene\', )
#62 _ =(\'GetSceneInfo\', )
#63 _ =(\'GetSelected\', )
#64 _ =(\'GetSrcObject\', )
#65 _ =(\'GetSrcObjectCount\', )
#66 _ =(\'GetSrcProperty\', )
#67 _ =(\'GetSrcPropertyCount\', )
#68 _ =(\'GetStatus\', )
#69 _ =(\'GetTakeInfo\', )
#70 _ =(\'GetTypeFlags\', )
#71 _ =(\'GetTypeName\', )
#72 _ =(\'GetUniqueID\', )
#73 _ =(\'GetUrl\', )
pFileFormat = importer.GetFileFormat()
# 02000 Reader Is FBX(int pFileFormat)
# ReaderIsFBX(int pFileFormat)
# 02100 リーダーは本物です (int pFileFormat) 
# ReaderIsGenuine(int pFileFormat)
# 00300 リーダーファイル形式を検出する (const char * pFileName、int&pFile形式) 
#DetectReaderFileFormat(const char *pFileName, int &pFileFormat)
# 00400 ライターファイル形式を検出する (const char * pFileName、intおよびpFileFormat) 
#DetectWriterFileFormat(const char *pFileName, int &pFileFormat)
# 00700 説明でのリーダーIDの検索 (const char * pDesc) 
# FindReaderIDByDescription(const char *pDesc)
# 00800 エクステンション別にリーダーIDを探す (const char * pExt)
# FindReaderIDByExtension(const char *pExt)
# 00900 説明でのライターIDの検索 (const char * pDesc)
# FindWriterIDByDescription(const char *pDesc)
# 01000 拡張子によるライターIDの検索 (const char * pExt)
# FindWriterIDByExtension(const char *pExt)
# 01100 ネイティブリーダー形式()を取得する
# GetNativeReaderFormat()
# 01200 ネイティブライターフォーマット()を取得する 
# GetNativeWriterFormat()
# 01300 リーダー形式のカウントを取得する() 
# GetReaderFormatCount()
# 01400 リーダー形式の説明を取得する (int pFileFormat)
# GetReaderFormatDescription(int pFileFormat)
# 01500 GetReaderフォーマット拡張 (int pFileFormat)
# GetReaderFormatExtension(int pFileFormat)
# 01600 書き込み可能なバージョンを取得する (int pFileFormat) 
# GetWritableVersions(int pFileFormat)
# 01700 Writer Format Count()を取得する 
# 01800 ライターフォーマットの説明を取得する (int pFileFormat) 
# GetWriterFormatDescription(int pFileFormat)
# 01900 ライターフォーマット拡張を得る (int pFileFormat)
# GetWriterFormatExtension(int pFileFormat)
DebugLog ("#==========================================================================================================================<BR /> ")
DebugLog ("#========================================== FbxIOPluginRegistry Format F B X ========================================================= STA <BR /> ")
DebugLog ("#========================================================================================================================== <BR /> ")
fileFormat =FbxIOPluginRegistry.GetNativeWriterFormat;
fileFormat=1 # FBX Ascii
fileFormat=2 # FBX binary
fileFormat = importer.GetFileFormat()
self.ref_TransZwriteReader_instance.DebugLog("\n"+" Save EXPORT F B X fileFormat = _ "+str(fileFormat) +" __ "+"\n" )
DebugLog ("#==========================================================================================================================")
DebugLog ("#========================================== File Format F B X ========================================================= STA")
DebugLog ("#==========================================================================================================================")
#==========================================================================================================================
#===================================================File Format F B X ======================================================== END
#==========================================================================================================================
#==========================================================================================================================
#===================================================Save EXPORT F B X N O W ======================================================== STA
#==========================================================================================================================
DebugLog ("#==========================================================================================================================")
DebugLog ("#========================================== Save EXPORT F B X N O W ========================================================= STA")
DebugLog ("#==========================================================================================================================")
#==========================================================================================================================
#===================================================File Format F B X ========================================================
#==========================================================================================================================
Export_Result = FbxCommon.SaveScene(manager, scene, self.FullPass_EXPORT_FBX_FILENAME,fileFormat)
if Export_Result==0:
print("Export_Result==0 NG !!!!!!!!!!!!!!!!!!!!!!!!!!!cant out file!!!!!!!!!!!!!!!!!!!!! ")
DebugLog("Export_Result==0 NG !!!!!!!!!!!!!!!!!!!!!!!!!!!cant out file!!!!!!!!!!!!!!!!!!!!! ")
DebugLog("Export_Result==0 NG !!!!!!!!!!!!!!!!!!!!!!!!!!!cant out file!!!!!!!!!!!!!!!!!!!!! ")
else:
print("Export_Result==1 OK !!!!!!!!!!!!!!!!!!!!!!!!!! out put File self.FullPass_EXPORT_FBX_FILENAME= "+self.FullPass_EXPORT_FBX_FILENAME)
DebugLog("Export_Result==1 OK !!!!!!!!!!!!!!!!!!!!!!!!!! out put File !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!")
DebugLog("Export_Result==1 OK !!!!!!!!!!!!!!!!!!!!!!!!!! out put File !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!")
DebugLog("Export_Result==1 OK !!!!!!!!!!!!!!!!!!!!!!!!!! out put File !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!")
DebugLog("Export_Result==1 OK !!!!!!!!!!!!!!!!!!!!!!!!!! out put File !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!")
DebugLog("Export_Result==1 OK !!!!!!!!!!!!!!!!!!!!!!!!!! out put File !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!")
#=============================================================================================================================
#=============================================================================================================================
#=============================================================================================================================
print ("==============Destroy All=========")
importer.Destroy()
def FbxImport_WriteReadTrans_Z_00610(self):
print("FbxImport_WriteReadTrans_Z_00610_Start............. filepath = "+str(filepath))
def Samething(self):
print("014 FbxImport_WriteReadTrans_Z_00610 Samething()")
#//////////////////////////////////////////////////////////////////////////////////////////////////
#//////////////////////////////////// Class Unit Test /////////////////////////////////////////////
#//////////////////////////////////////////////////////////////////////////////////////////////////
def getClassName(self):
print( u"className= " + self.__class__.__name__)
return self.__class__.__name__
#=============================Code Start===============================================
print(" Code Start="+__name__)
Debug_Instance=DebugLogger00100.DebugLogger00100()
def DebugLogStart():
#print("DebugStr = "+ DebugStr)
Debug_Instance.DebugLogStart()
def DebugLog(DebugStr):
print("DebugStr = "+ DebugStr)
Debug_Instance.DebugLog(" 88 Logger >>>>>>>>"+DebugStr);
#====================================================
#================== DisplayCommon.py ===================
#====================================================
def DisplayString(pHeader, pValue="" , pSuffix=""):
lString = pHeader
lString += str(pValue)
lString += pSuffix
print(lString)
#================== DisplayCommon.py ===================END
#====================================================
#====================================================
#================== DisplayGlobalSettings.py ===================STA
#====================================================
def DisplayGlobalTimeSettings(pGlobalSettings):
DebugLog("465 line DisplayGlobalTimeSettings() pGlobalSettings= "+ str(pGlobalSettings) )
lTimeModes = [ "Default Mode", "Cinema", "PAL", "Frames 30",
"NTSC Drop Frame", "Frames 50", "Frames 60",
"Frames 100", "Frames 120", "NTSC Full Frame",
"Frames 30 Drop", "Frames 1000" ]
pGlobalSettings_GetTimeMode =pGlobalSettings.GetTimeMode()
DebugLog("471 line pGlobalSettings.GetTimeMode() = "+ str( pGlobalSettings_GetTimeMode ) )
lTimeModes_Arr_pGlobalSettings_GetTimeMode =lTimeModes[ pGlobalSettings_GetTimeMode ]
DebugLog("473 line lTimeModes_Arr_pGlobalSettings_GetTimeMode = "+ str( lTimeModes_Arr_pGlobalSettings_GetTimeMode ) )
DisplayString(" ImportScene_00100.py 0105line globalTimeSettings.py DisplayGlobalTimeSettings () Time Mode: ", lTimeModes[pGlobalSettings.GetTimeMode()])
lTs = pGlobalSettings.GetTimelineDefaultTimeSpan()
lStart = lTs.GetStart()
lEnd = lTs.GetStop()
DisplayString("Timeline default timespan: ")
lTmpStr=""
DisplayString(" Start: ", lStart.GetTimeString(lTmpStr, 10))
DisplayString(" Stop : ", lEnd.GetTimeString(lTmpStr, 10))
DisplayString("")
#====================================================
#================== DisplayGlobalSettings.py ===================END
#====================================================
FBX_trans_z_Instance = FbxImport_WriteReadTrans_Z_00610() # Class export instance.
GetKeyCurve_Instance = GetKeyCurve00110.GetKeyCurve00110() # Class export instance.
print(" FbxImport_WriteReadTrans_Z_00610 Class __name__="+__name__)
WriteReadTrans_ZInstance=WriteReadTrans_Z_00310.WriteReadTrans_Z_00310()
WriteReadTrans_ZInstance.fileDataZeroReset()
#//////////////////////////////////////////////////////////////////////////////////////////////////
#//////////////////////////////////// Class Unit Test /////////////////////////////////////////////
#//////////////////////////////////////////////////////////////////////////////////////////////////
def StartMainLine(Debug,WriteReadTrans_Z_Instance,FBX_trans_z_Instance,GetKeyCurve_Instance):
print(" ========================== StartMainLine ========================== ")
print(" ========================== StartMainLine ========================== ")
print(" ========================== StartMainLine ========================== ")
DebugLogStart()
FBX_trans_z_Instance.Samething()
FBX_trans_z_Instance.loadFile(FBX_trans_z_Instance.FBX_FILE_PATH_AND_NAME_AND_EXT,WriteReadTrans_Z_Instance,GetKeyCurve_Instance)
print(" ========================== END StartMainLine ========================== ")
print(" ========================== END StartMainLine ========================== ")
print(" ========================== END StartMainLine ========================== ")
print(" ========================== END StartMainLine ========================== ")
#DebugLog (u"__name__==self.__class__.__name__ Same!! File Test")
#DebugLog (u"=============Simple Single Class Unit Test Start==========")
#Instance.FbxImport_WriteReadTrans_Z_00610() #Call Method
#//////////////////////////////////////////////////////////////////////////////////////////////////
#//////////////////////////////////// Class Unit Test /////////////////////////////////////////////
#//////////////////////////////////////////////////////////////////////////////////////////////////
if(__name__ == FBX_trans_z_Instance.getClassName()):
print (u"============= 01 Simple Single Class Unit Test Start==== Instance.getClassName() = "+FBX_trans_z_Instance.getClassName()+" =====")
#StartMainLine(Debug_Instance,WriteReadTrans_ZInstance,FBX_trans_z_Instance)
elif(__name__ == "FbxImport_WriteReadTrans_Z_00610"):
print (u"============= 02 Simple Single Class Unit Test Start===== StartMainLine =====")
#StartMainLine(Debug_Instance,WriteReadTrans_ZInstance,FBX_trans_z_Instance)
#Instance.loadFile(FBX_FILE_PATH_AND_NAME_AND_EXT)
elif(__name__ == "__main__"):
print (u"============= 03 Simple Single Class Unit Test Start===== __main__ =====")
StartMainLine(Debug_Instance,WriteReadTrans_ZInstance,FBX_trans_z_Instance,GetKeyCurve_Instance)
else:
print (u"__name__!=self.__class__.__name__ Othor File Import")
#===================GetKeyCurve=========================
#===================GetKeyCurve=========================
#===================GetKeyCurve=========================
#===================GetKeyCurve=========================
def GetKeyCurve(fbxImporter,pScene):
print ("===========GetKeyCurve(pScene= "+str(fbxImporter)+" pScene="+str(pScene)+" )===========")
print ("===========GetKeyCurve(pScene= "+str(fbxImporter)+" pScene="+str(pScene)+" )===========")
print ("===========GetKeyCurve(pScene= "+str(fbxImporter)+" pScene="+str(pScene)+" )===========")
print ("===========GetKeyCurve(pScene= "+str(fbxImporter)+" pScene="+str(pScene)+" )===========")
#===================GetKeyCurve=========================
#===================GetKeyCurve=========================
#===================GetKeyCurve=========================
#===================GetKeyCurve=========================
print ("GetKeyCurve(pScene= "+str(fbxImporter)+" pScene="+str(pScene)+" )")
#==SDKの1シーンであるFbxScene sceneをルートとして次のようにします:
#==① アニメーションスタック数取得
#int nbAnimStacks = pScene->GetSrcObjectCount<FbxAnimStack>()
print ("----GetKeyCurve( fbxImporter.GetAnimStackCount()= "+str(fbxImporter.GetAnimStackCount())+" -------------------")
intAnimStacks=0
intAnimStacks=fbxImporter.GetAnimStackCount()
print ("----GetKeyCurve------ intAnimStacks= "+str(intAnimStacks)+" -------------------")
print ("----GetKeyCurve( fbxImporter.GetActiveAnimStackName()= "+str(fbxImporter.GetActiveAnimStackName())+" -------------------")
#==② アニメーションスタック取得
#for ( int i = 0; i < nbAnimStacks; i++ )
#FbxAnimStack* lAnimStack = pScene->GetSrcObject<FbxAnimStack>(i);
TakeInfoList= [0 for i in range(1)]
del TakeInfoList[0]
for i in range(0, intAnimStacks):
DebugLog("for i="+str(i))
pTakeInfo=fbxImporter.GetTakeInfo(i);
DebugLog("for pTakeInfo="+str(pTakeInfo))
pTakeName = pTakeInfo.mName;
DebugLog("for pTakeName="+str(pTakeName))
mImportName = pTakeInfo.mImportName;
DebugLog("for mImportName="+str(mImportName))
#===========END=====GetKeyCurve=========================
#===========END=====GetKeyCurve=========================
#===========END=====GetKeyCurve=========================
#===========END=====GetKeyCurve=========================
#===========END=====GetKeyCurve=========================
print ("==== END ==GetKeyCurve(pScene= "+str(fbxImporter)+" pScene="+str(pScene)+" )===========")
print ("==== END ==GetKeyCurve(pScene= "+str(fbxImporter)+" pScene="+str(pScene)+" )===========")
print ("==== END ==GetKeyCurve(pScene= "+str(fbxImporter)+" pScene="+str(pScene)+" )===========")
print ("==== END ==GetKeyCurve(pScene= "+str(fbxImporter)+" pScene="+str(pScene)+" )===========")
print ("==== END ==GetKeyCurve(pScene= "+str(fbxImporter)+" pScene="+str(pScene)+" )===========")
@whaison
Copy link
Author

whaison commented Feb 7, 2017

	FbxIOFileHeaderInfo_FileHeaderInfo_= importer.GetFileHeaderInfo()
	DebugLog("FbxIOFileHeaderInfo_FileHeaderInfo_"  +   str(FbxIOFileHeaderInfo_FileHeaderInfo_)   )
	bool_HeaderInfo_ReadExtendedHeaderInformation_= FbxIOFileHeaderInfo_FileHeaderInfo_.ReadExtendedHeaderInformation
	DebugLog("bool_HeaderInfo_ReadExtendedHeaderInformation_"  +   str(bool_HeaderInfo_ReadExtendedHeaderInformation_)   )
	
	DebugLog("============================  F B X F O R M A T V E R S I O N ================================================="   )
	DebugLog("============================  F B X F O R M A T V E R S I O N ================================================="   )
	DebugLog("============================  F B X F O R M A T V E R S I O N ================================================="   )	
	DebugLog("============================  F B X F O R M A T V E R S I O N ================================================="   )
	FbxString_HeaderInfo_mCreator= FbxIOFileHeaderInfo_FileHeaderInfo_.mCreator
	DebugLog("Maya Plugin FbxString_HeaderInfo_mCreator = "  +   str(FbxString_HeaderInfo_mCreator)   )
	FbxString_HeaderInfo_mFileVersion= FbxIOFileHeaderInfo_FileHeaderInfo_.mFileVersion
	DebugLog("FbxString_HeaderInfo_mFileVersion = "  +   str(FbxString_HeaderInfo_mFileVersion)   )
	if FbxString_HeaderInfo_mFileVersion==6100:
		DebugLog(   "2006_2009_2010_FBX 6.1.0 project file"   )
	if FbxString_HeaderInfo_mFileVersion==7100:
		DebugLog(   "2011_FBX 7.1.0 project file"   )
	if FbxString_HeaderInfo_mFileVersion==7200:
		DebugLog(   "2012_FBX 7.2.0 project file"   )
	if FbxString_HeaderInfo_mFileVersion==7300:
		DebugLog(   "2013_FBX 7.3.0 project file"   )
	if FbxString_HeaderInfo_mFileVersion==7400:
		DebugLog(   "2014_2015_FBX 7.4.0 project file"   )
	if FbxString_HeaderInfo_mFileVersion==7500:
		DebugLog(   "2016_2017_FBX 7.5.0 project file"   )
	DebugLog("============================  F B X F O R M A T V E R S I O N ================================================="   )
	DebugLog("============================  F B X F O R M A T V E R S I O N ================================================="   )
	DebugLog("============================  F B X F O R M A T V E R S I O N ================================================="   )
	DebugLog("============================  F B X F O R M A T V E R S I O N ================================================="   )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment