Announcement

Collapse
No announcement yet.

Get and assign Material of a BSP via UnrealScript.

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

    Get and assign Material of a BSP via UnrealScript.

    Hi guys,
    I'm currently trying to change a parameter of a material on all my Objects in my scene. I was thinking about getting all the objects with "foreach", and that wont be the problem. But I don't know how to get the material of my BSP.
    I thought I could get all actors of type "brush" but I don't know how the get the material of them.
    Can anybody help?

    Voleuro

    #2
    I doubt that you can do it; especially as brushes do not generally have a single material. Somewhere in native code, that brush will have a Model, which probably contains the references - I suspect that there'll be no access from UnrealScript.

    I'd like to be proven wrong though.

    Comment


      #3
      Thanks a lot for the Answer. Another question. Is it possible to get all Material Instances in a scene. So I wont have to go over the brush and directly get my Material I need?
      I want do set a vector parameter for all my Materials every Frame. I thought I just would have to get all materials first. But I don't know how. Anybody?

      Voleuro

      Comment


        #4
        You possibly could, but that would be a royal pain. Why not just have a lot of instances that are parented from one other instance, and change the parameter in there? The change in the parent should propagate to all children as far as I'm aware.

        Comment


          #5
          Thanks a lot for your answer. That's a nice idea. Only Problem is, that I don't know how to do this. Can you help me?

          Thanks,
          Voleuro

          Comment


            #6
            Create a material - create an instance of that material, then all of your materials will be an instance of that. In your code, you only need one reference - the first instance. If you set the parameter on that, you should be good to go.

            Technically speaking, you shouldn't edit an instance that's saved into a package through code, but it's probably the best option.

            Comment


              #7
              Thanks. It works now.

              Voleuro

              Comment

              Working...
              X