def WBPsel(): try: filename = unreal_engine.save_file_dialog('Save a Text file', '', '', 'TXT|*.txt')[0] selwb = ue.get_selected_assets() settext = [] count = 0 startline = '위젯블루프린트이름\t위젯오브젝트이름\t문자열\t폰트이름\tLocalKey\tLocalNameSpace\t기획 로컬 체크\t코드제어 여부\t비고\n' settext.append(startline) for wb in selwb: try: ue.log('{0} SaveText : {1}'.format(count, wb.get_name())) for i in WBAssetObj(wb): settext.append(i) except: ue.log('Error!! : {0}'.format(wb.get_name())) count = count + 1 #텍스트파일 생성 if len(settext) > 1: TextwriteAll(settext, filename) else: ue.log('### 저장 할 정보가 없습니다###') except: ue.log('### 저장을 취소하였습니다###')
def export_selected_asset(savePath=None): uasset = ue.get_selected_assets() savePath = ue.open_directory_dialog("") if not savePath: savePath = ue.open_directory_dialog("") if savePath: ue.export_assets(staticMeshes, savePath)
def pick_content(self, vm, event_args): ''' Command to gather the UE4 selected Content Browser asset Args: vm (UnrealTools.UE4AssetCreator.DestructionCreatorVM): C# view model object sending the command event_args (PickContentEventArgs): C# EventArgs to pass over the string Path of a UE4 asset ''' event_args.Path = ue.get_selected_assets()[0].get_path_name()
def rotate_selected_assets_data(degrees): for asset in ue.get_selected_assets(): if asset.is_a(Texture2D): data = asset.texture_get_source_data() size = (asset.texture_get_width(), asset.texture_get_height()) img = Image.frombytes('RGBA', size, bytes(data)) out = img.rotate(degrees) asset.texture_set_source_data(out.tobytes())
def Wtestxx(): selbp = ue.get_selected_assets() for aa in selbp: aa.save_package() uw = aa.WidgetTree allwid = uw.AllWidgets for wb in allwid: if wb.get_class().get_name() == 'TextBlock': try: ue.log(wb.get_name()) wb.Text = '' except: ue.log('Error!!') if wb.get_class().get_name() == 'IMTextBlock': try: ue.log(wb.get_name()) ue.log(wb.Content) wb.Content = '' except: ue.log('Error!!') ue.compile_blueprint(aa) aa.save_package()
seq_num_pin = node_sequence.add_pin() seq_num_pin.make_link_to(pin_branch_exec) # -------------------------------------------------------------------------------------------------------------------------------------- # import unreal_engine as ue import sys sys.path.append(r"C:\Python36\Lib\site-packages") import PySide2 from PySide2 import QtGui from PySide2 import QtWidgets assets = ue.get_selected_assets() property_list = [] for asset in assets: asset_properties = asset.properties() for p in asset_properties: if p not in property_list: property_list.append(p) app = QtWidgets.QApplication.instance() if not app: app = QtWidgets.QApplication() class widget(QtWidgets.QWidget): def __init__(self, parent=None): super(widget, self).__init__(parent)
import unreal_engine as ue from unreal_engine.structs import KAggregateGeom mesh = ue.get_selected_assets()[0] mesh.BodySetup.AggGeom = KAggregateGeom() mesh.static_mesh_generate_kdop26() mesh.static_mesh_generate_kdop18() mesh.static_mesh_generate_kdop10x() mesh.static_mesh_generate_kdop10y() mesh.static_mesh_generate_kdop10z()
def fn_sel(): arraylist = [] selbp = ue.get_selected_assets() for i in selbp: arraylist.append(i.get_path_name()) fn_writetext(arraylist)
# extract root motion root_motion = [position - data.pos_keys[0] for position in data.pos_keys] # remove root motion from original track data.pos_keys = [data.pos_keys[0]] new_anim.add_new_raw_track(name, data) # create a new track (the root motion one) root_data = FRawAnimSequenceTrack() root_data.pos_keys = root_motion # ensure empty rotations ! root_data.rot_keys = [FQuat()] # add the track new_anim.add_new_raw_track('root', root_data) else: new_anim.add_new_raw_track(name, data) new_anim.save_package() root_motion_fixer = RootMotionFixer() for uobject in ue.get_selected_assets(): if uobject.is_a(SkeletalMesh): root_motion_fixer.add_root_to_skeleton(uobject) elif uobject.is_a(AnimSequence): root_motion_fixer.split_hips(uobject) else: raise DialogException('Only Skeletal Meshes are supported')
# run this script in the python editor of the UE4 editor after selecting an asset in the asset browser # in order to see that path for this class (useful for loading a class via ue.load_class). import unreal_engine as ue ue.log(ue.get_selected_assets()[0].get_path_name())