Skip to content

Commit

Permalink
lovely message added lastely
Browse files Browse the repository at this point in the history
  • Loading branch information
Mino-is-me committed Mar 31, 2022
1 parent 1e20553 commit 2c8d778
Show file tree
Hide file tree
Showing 5 changed files with 211 additions and 31 deletions.
2 changes: 1 addition & 1 deletion Exporter/TheExporter.ms
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,7 @@ rollout 'Exporter' "Exporter" width:505 height:723
listBox 'mlb_FileNames' "File List" pos:[28,139] width:433 height:16 align:#left
button 'btn_FilePath' "Select Export Path" pos:[24,394] width:93 height:34 align:#left
editText 'et_FilePath' "" pos:[120,393] width:343 height:35 align:#left
dropDownList 'ddl_Species' "Species" pos:[20,461] width:448 height:41 items:#("PC(EVE)", "MOB(NA)", "Weapon(WP)", "Parts(EVE)", "CAM") align:#left selection:Species
dropDownList 'ddl_Species' "Species" pos:[20,461] width:448 height:41 items:#("PC(EVE)", "MOB(NA) or General", "Weapon(WP)", "Parts(EVE)", "CAM") align:#left selection:Species
dropDownList 'ddl_exportOption' "Export Option" pos:[20,500] width:448 height:41 items:#("Skeletal Mesh", "Animation", "Selected Mesh Only", "All", "Selected", "Seperated") selection:exportOption align:#left
button 'btn_export' "Export" pos:[305,20] width:158 height:90 align:#left
groupBox 'grp1' "Import / Export" pos:[9,5] width:467 height:118 align:#left
Expand Down
Original file line number Diff line number Diff line change
@@ -1,28 +1,25 @@
import unreal
import re
from typing import List, Literal

def get_bp_c_by_name(__bp_dir:str):
def get_bp_c_by_name(__bp_dir:str) -> str :
__bp_c = __bp_dir + '_C'
return __bp_c

def get_bp_mesh_comp (__bp_c:str) :
def get_bp_mesh_comp (__bp_c:str) -> object :
#source_mesh = ue.load_asset(__mesh_dir)
loaded_bp_c = unreal.EditorAssetLibrary.load_blueprint_class(__bp_c)
bp_c_obj = unreal.get_default_object(loaded_bp_c)
loaded_comp = bp_c_obj.get_editor_property('Mesh')
return loaded_comp




ar_asset_lists = []
ar_asset_lists = unreal.EditorUtilityLibrary.get_selected_assets()
ar_asset_lists : List[object] = unreal.EditorUtilityLibrary.get_selected_assets()

SkeletalMesh = ar_asset_lists[0]

print (ar_asset_lists[0])

str_selected_asset = ''
str_selected_asset : str

if len(ar_asset_lists) > 0 :

Expand All @@ -36,19 +33,16 @@ def get_bp_mesh_comp (__bp_c:str) :

num = int(i_number)

BaseBP = '/Game/Art/Character/Monster/CH_D_NA_Core/CH_M_NA_Core_BP'
BaseAnimBP = '/Game/Art/Character/Monster/CH_D_NA_Core/CH_M_NA_Core_AnimBP'

Basepath = '/Game/Art/Character/Monster/CH_M_NA_' + str(num) + '/'
assetPath = Basepath + '/Animation/BlendSpace/'
bsNames = ["IdleRun_BS_Peaceful", "IdleRun_BS_Battle", "Down_BS", "Groggy_BS", "LockOn_BS", "Airborne_BS"]
#animNames = ['Result_State_KnockDown_L'] #애니메이션 리스트 지정
Base1D = Basepath + "Base_BS_1D"
Base2D = Basepath + "Base_BS_2D"
BaseBP :str = '/Game/Art/Character/Monster/CH_D_NA_Core/CH_M_NA_Core_BP'
BaseAnimBP :str = '/Game/Art/Character/Monster/CH_D_NA_Core/CH_M_NA_Core_AnimBP'
Basepath :str = '/Game/Art/Character/Monster/CH_M_NA_' + str(num) + '/'
assetPath :str = Basepath + '/Animation/BlendSpace/'
bsNames :List[str] = ["IdleRun_BS_Peaceful", "IdleRun_BS_Battle", "Down_BS", "Groggy_BS", "LockOn_BS", "Airborne_BS"]
Base1D :str = Basepath + "Base_BS_1D"
Base2D :str = Basepath + "Base_BS_2D"
defaultSamplingVector :object = unreal.Vector(0.0, 0.0, 0.0)
defaultSampler :object = unreal.BlendSample()

#공용 BlendSample 제작
defaultSamplingVector = unreal.Vector(0.0, 0.0, 0.0)
defaultSampler = unreal.BlendSample()
defaultSampler.set_editor_property("sample_value",defaultSamplingVector)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
## run with python 2.7 in UE4

#######################################import modules from here#################################
from pyclbr import Class
import unreal
import re
from typing import List
#######################################import modules end#######################################


Expand All @@ -22,7 +24,7 @@ def get_selected_asset_dir() -> str :
return path


def get_anim_list (__path: str) -> list :
def get_anim_list (__path: str) -> List[str] :
seq_list = unreal.EditorAssetLibrary.list_assets(__path, False, False)
return seq_list

Expand All @@ -42,7 +44,7 @@ def check_animseq_by_name_in_list (__anim_name: str, __list: list ) -> str :
##애니메이션을 못찾으면 끼워넣지 않아요!


def set_bs_sample (__animation, __axis_x: float, __axis_y: float) : # returns [BlendSample] unreal native type
def set_bs_sample (__animation, __axis_x: float, __axis_y: float) -> object : # returns [BlendSample] unreal native type
bs_sample = unreal.BlendSample()
vec_sample = unreal.Vector(__axis_x, __axis_y, 0.0) #do not use 3D BlendSampleVector
bs_sample.set_editor_property('animation', __animation)
Expand All @@ -53,19 +55,19 @@ def set_bs_sample (__animation, __axis_x: float, __axis_y: float) : # returns [B



def set_blendSample_to_bs (__blendspace, __blendsample) : #returns [BlendSpace] unreal loaded asset
def set_blendSample_to_bs (__blendspace, __blendsample) -> int : #returns [BlendSpace] unreal loaded asset
__blendspace.set_editor_property('sample_data', __blendsample)
return 0

def set_blendParameter (__min: float , __max: float) :
def set_blendParameter (__min: float , __max: float) -> object :
bs_parameter = unreal.BlendParameter()
bs_parameter.set_editor_property('display_name', 'none')
bs_parameter.set_editor_property('grid_num', 4)
bs_parameter.set_editor_property('min', __min)
bs_parameter.set_editor_property('max', __max)
return bs_parameter

def set_square_blendSpace (__blendspace, __blendparameter) :
def set_square_blendSpace (__blendspace, __blendparameter) -> None :
__blendspace.set_editor_property('blend_parameters', [__blendparameter,__blendparameter,__blendparameter])
#######################################functions end#######################################

Expand Down Expand Up @@ -108,14 +110,14 @@ class wrapedBlendSpaceSetting:
#######################################class end#######################################

#######################################run from here#######################################
wraped = wrapedBlendSpaceSetting()
wraped :Class = wrapedBlendSpaceSetting()
wraped.main_dir = get_selected_asset_dir()

seek_anim_path = wraped.main_dir + wraped.custom_input
bs_path = wraped.main_dir + wraped.bs_dir
seek_anim_path = wraped.main_dir + wraped.custom_input
bs_path = wraped.main_dir + wraped.bs_dir

anim_list = get_anim_list(seek_anim_path)
name_list : list = []
anim_list = get_anim_list(seek_anim_path)
name_list :list = []


for each in wraped.seq_names :
Expand Down
156 changes: 156 additions & 0 deletions Temp/fastexport.ms
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
list_nodes = #()
append list_nodes $'Root'
append list_nodes $'SC_LinkTarget'
append list_nodes $'Bip001'
append list_nodes $'Bip001 Pelvis'
append list_nodes $'Bip001 Spine'
append list_nodes $'Bip001 Spine1'
append list_nodes $'Bip001 Spine2'
append list_nodes $'Bip001 Neck'
append list_nodes $'Bip001 L Clavicle'
append list_nodes $'Bip001 L Hand'
append list_nodes $'Bip001 L Finger0'
append list_nodes $'Bip001 L Finger01'
append list_nodes $'Bip001 L Finger02'
append list_nodes $'Bip001 L Finger1'
append list_nodes $'Bip001 L Finger11'
append list_nodes $'Bip001 L Finger12'
append list_nodes $'Bip001 L Finger2'
append list_nodes $'Bip001 L Finger21'
append list_nodes $'Bip001 L Finger22'
append list_nodes $'Bip001 L Finger3'
append list_nodes $'Bip001 L Finger31'
append list_nodes $'Bip001 L Finger32'
append list_nodes $'Bip001 L Finger4'
append list_nodes $'Bip001 L Finger41'
append list_nodes $'Bip001 L Finger42'
append list_nodes $'Ab L ForeArm Twist'
append list_nodes $'Ab L ForeArm Twist1'
append list_nodes $'Ab L Forearm Sub'
append list_nodes $'Ab L UpperArm Twist'
append list_nodes $'Ab L UpperArm Twist1'
append list_nodes $'Ab L UpperArm Sub'
append list_nodes $'CapeC_L_1'
append list_nodes $'CapeC_L_2'
append list_nodes $'CapeC_L_3'
append list_nodes $'CapeC_L_4'
append list_nodes $'CapeC_L_5'
append list_nodes $'CapeC_L_6'
append list_nodes $'CapeC_L_7'
append list_nodes $'CapeB_L_1'
append list_nodes $'CapeB_L_2'
append list_nodes $'CapeB_L_3'
append list_nodes $'CapeB_L_4'
append list_nodes $'CapeB_L_5'
append list_nodes $'CapeB_L_6'
append list_nodes $'CapeB_L_7'
append list_nodes $'CapeA_L_1'
append list_nodes $'CapeA_L_2'
append list_nodes $'CapeA_L_3'
append list_nodes $'CapeA_L_4'
append list_nodes $'CapeA_L_5'
append list_nodes $'CapeA_L_6'
append list_nodes $'CapeA_L_7'
append list_nodes $'LeftCapeBelt2_RSJnt'
append list_nodes $'Bip001 R Clavicle'
append list_nodes $'Bip001 R Hand'
append list_nodes $'Bip001 R Finger0'
append list_nodes $'Bip001 R Finger01'
append list_nodes $'Bip001 R Finger02'
append list_nodes $'Bip001 R Finger1'
append list_nodes $'Bip001 R Finger11'
append list_nodes $'Bip001 R Finger12'
append list_nodes $'Bip001 R Finger2'
append list_nodes $'Bip001 R Finger21'
append list_nodes $'Bip001 R Finger22'
append list_nodes $'Bip001 R Finger3'
append list_nodes $'Bip001 R Finger31'
append list_nodes $'Bip001 R Finger32'
append list_nodes $'Bip001 R Finger4'
append list_nodes $'Bip001 R Finger41'
append list_nodes $'Bip001 R Finger42'
append list_nodes $'SC_WeaponConstraint'
append list_nodes $'Ab R ForeArm Twist'
append list_nodes $'Ab R ForeArm Twist1'
append list_nodes $'Ab R Forearm Sub'
append list_nodes $'Ab R UpperArm Twist'
append list_nodes $'Ab R UpperArm Twist1'
append list_nodes $'Ab R UpperArm Sub'
append list_nodes $'CapeC_R_1'
append list_nodes $'CapeC_R_2'
append list_nodes $'CapeC_R_3'
append list_nodes $'CapeC_R_4'
append list_nodes $'CapeC_R_5'
append list_nodes $'CapeC_R_6'
append list_nodes $'CapeC_R_7'
append list_nodes $'CapeB_R_1'
append list_nodes $'CapeB_R_2'
append list_nodes $'CapeB_R_3'
append list_nodes $'CapeB_R_4'
append list_nodes $'CapeB_R_5'
append list_nodes $'CapeB_R_6'
append list_nodes $'CapeB_R_7'
append list_nodes $'CapeA_R_1'
append list_nodes $'CapeA_R_2'
append list_nodes $'CapeA_R_3'
append list_nodes $'CapeA_R_4'
append list_nodes $'CapeA_R_5'
append list_nodes $'CapeA_R_6'
append list_nodes $'CapeA_R_7'
append list_nodes $'RightCapeBelt2_RSJnt'
append list_nodes $'Bip001 Head'
append list_nodes $'Mark'
append list_nodes $'HeadCloth1'
append list_nodes $'HeadCloth2'
append list_nodes $'HeadCloth3'
append list_nodes $'HeadCloth4'
append list_nodes $'HeadCloth5'
append list_nodes $'HeadCloth6'
append list_nodes $'HeadCloth7'
append list_nodes $'HeadCloth8'
append list_nodes $'HeadCloth9'
append list_nodes $'HeadCloth10'
append list_nodes $'HeadCloth11'
append list_nodes $'Head_Ring'
append list_nodes $'Hair1'
append list_nodes $'Hair2'
append list_nodes $'Hair3'
append list_nodes $'Hair4'
append list_nodes $'Hair5'
append list_nodes $'Hair6'
append list_nodes $'Hair7'
append list_nodes $'Ab NeckSub'
append list_nodes $'BackCape_1'
append list_nodes $'BackCape_2'
append list_nodes $'BackCape_3'
append list_nodes $'BackCape_4'
append list_nodes $'BackCape_5'
append list_nodes $'BackCape_6'
append list_nodes $'BackCape_7'
append list_nodes $'MidCapeBelt_RSJnt'
append list_nodes $'Breast_R'
append list_nodes $'RightCapeBelt1_RSJnt'
append list_nodes $'Breast_L'
append list_nodes $'LeftCapeBelt1_RSJnt'
append list_nodes $'Bip001 L Foot'
append list_nodes $'Ab L Toe0'
append list_nodes $'Ab L Calf Twist'
append list_nodes $'Ab L Calf Twist1'
append list_nodes $'Ab L Calf Sub'
append list_nodes $'Ab L Thigh Twist'
append list_nodes $'Ab L Thigh Twist1'
append list_nodes $'Ab L Thigh Sub'
append list_nodes $'Bip001 R Foot'
append list_nodes $'Ab R Toe0'
append list_nodes $'Ab R Calf Twist'
append list_nodes $'Ab R Calf Twist1'
append list_nodes $'Ab R Calf Sub'
append list_nodes $'Ab R Thigh Twist'
append list_nodes $'Ab R Thigh Twist1'
append list_nodes $'Ab R Thigh Sub'
append list_nodes $'Bip001 Prop1'
append list_nodes $'Body_Ring'
append list_nodes $'weaponXpose'
append list_nodes $'Weapon_Base'

select list_nodes
28 changes: 28 additions & 0 deletions Temp/propSysRenewal.ms
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
files = Exporter.mlb_FileNames.items


for each in files do (
loadMaxFile each quiet:true

nameWithoutType = getFilenameFile MaxFileName
saveName = MaxFilePath + nameWithoutType + "_baked.max"

weaponXpose = dummy()
weaponXpose.name = "weaponXpose"
weaponXpose.parent = $Root

with animate on (
for i in animationRange.start to animationRange.end do (
sliderTime = i
weaponXpose.transform = $'Bip001 Prop1'.transform
)
)
sliderTime = animationRange.start

saveMaxFile saveName quiet:true
)



/* test code here */

0 comments on commit 2c8d778

Please sign in to comment.