Reading material from PyActor

Hello alltogether,

so, I want to get a PyActors Material, but don’t know how to do it. I’m an absolute beginner and need to get familiar with the Unreal API. Here’s my little python script:



import unreal_engine as ue
import ifcopenshell as ifc
import os

class main:

    def begin_play(self):

        base_path = os.path.dirname(os.path.realpath(__file__))
        ifc_file_path = os.path.join(base_path, "ifc_database\\hyperflex_V1.ifc")
        ifc_filename = os.path.basename(ifc_file_path)
        python_filename = os.path.basename(__file__)

        LOCATION = self.uobject.get_actor_location()
        ROTATION = self.uobject.get_actor_rotation()
**MATERIAL = **
        LABEL = self.uobject.get_actor_label()
        TYPE = 'FLOOR' #set to 12 characters max


I can read out the actors position and rotation as you can see, now I want to read the material that I assign, this is how I assign materials:

https://i.imgur.com/IvP2UvP.jpg

Good morning,

I want to help you, but I have a question.
Are you using Epic’s Python plugin or another one?

If this is Epic’s plugin, how did you get your PyActor?

Oh… yeah, I’m not using Epic’s integrated Python Plugin, I’m using this one: GitHub - 20tab/UnrealEnginePython: Embed Python in Unreal Engine 4

Ok that’s what I thought.
I did not have the chance to try it yet. I cannot help you, sorry :frowning:

SOLVED: u_material = self.uobject.material_name

where ‘material_name’ is a string type variable that I’ve set up in the constrution script of the blueprint:

https://forums.unrealengine.com/filedata/fetch?filedataid=155194&type=thumb