示例#1
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# The ue_site.py python file gets executed on launch every time you start the engine, so any function you want on startup
# All our main code is called from ms_setup.py.

import unreal_engine as ue

ue.exec("ms_setup.py")



示例#2
0
def init_megascans_ui():
    ue.exec("UI.py")
示例#3
0
def init_megascans_ui():
    ue.exec("ms_user_interface.py")
示例#4
0
import unreal_engine as ue

# Initialize our main modules.
ue.exec("ms_Init.py")

project_path = f"{os.path.dirname(sys.argv[0])}"
current_path = f"{project_path}/Plugins/CoDtoUE"


def init_megascans_ui():
    ue.exec("UI.py")


# Initialize our asyncio task. This task will be running in the background to check for new assets to import.
# loop = asyncio.new_event_loop()
# asyncio.set_event_loop(loop)
# ticker = ue.add_ticker(ms_ticker_loop)
# asyncio.ensure_future(ms_simple_timer(1))
print("Megascans Integration - LiveLink Initialized...")

# The following snippet is used to create the "Megascans" icon in the UE4 toolbar.

style = FSlateStyleSet('PyStyle')
brush = SlateBrush(TintColor=SlateColor(
    SpecifiedColor=FLinearColor(1, 0, 0, 1)))
style.set('SolidBrush001', brush)
brush2 = SlateBrush(ResourceName=(current_path + '/ToolLogo.png'),
                    ImageSize=Vector2D(X=45, Y=45))
style.set('ImageBrush001', brush2)
style.register()
示例#5
0
import unreal_engine as ue

# Initialize our main modules.

ue.exec("ms_Init.py")
ue.exec("ms_main.py")


#Function to open the user interface. This function is called by the mousePressEvent of the "Megascans" icon in the UE4 toolbar.
def init_megascans_ui():
    ue.exec("ms_user_interface.py")


# Initialize our asyncio task. This task will be running in the background to check for new assets to import.

loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
ticker = ue.add_ticker(ms_ticker_loop)
asyncio.ensure_future(ms_simple_timer(1))
print("Megascans Integration - LiveLink Initialized...")
#ms_bridge_listener_cancel()

# The following snippet is used to create the "Megascans" icon in the UE4 toolbar.

style = FSlateStyleSet('PyStyle')
brush = SlateBrush(TintColor=SlateColor(SpecifiedColor=FLinearColor(1, 0, 0, 1)))
style.set('SolidBrush001', brush)
brush2 = SlateBrush(ResourceName=(custom_path + '/MS_Logo.png'), ImageSize=Vector2D(X=45, Y=45))
style.set('ImageBrush001', brush2)
style.register()