Announcement

Collapse
No announcement yet.

Reading material from PyActor

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    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:

    Code:
    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:


    #2
    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?
    Have An Awesome And Productive Day
    Alex, Youtube Tutorials

    Comment


      #3
      Originally posted by AlexQuevillon View Post
      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: https://github.com/20tab/UnrealEnginePython

      Comment


        #4
        Ok that's what I thought.
        I did not have the chance to try it yet. I cannot help you, sorry
        Have An Awesome And Productive Day
        Alex, Youtube Tutorials

        Comment


          #5
          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:



          Comment

          Working...
          X