Announcement

Collapse
No announcement yet.

Python - set_editor_property Directional Light

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

    Python - set_editor_property Directional Light

    Is it possible in Python to use "set_editor_property" on a Directional Light?

    I've tried:

    .set_editor_property("Intensity", 100)

    But this doesn't work. Nor does removing the quotes. Any suggestions?
    Eldridge Felder

    Animation/Visualization Manager
    WorthGroup Architects

    #2
    Looks like the intensity is underneath the lightComponent not the main actor itself.


    Code:
    sun_location = unreal.Vector(0.0, 0.0, 500.0)
    lightObj = unreal.EditorLevelLibrary.spawn_actor_from_class(unreal.DirectionalLight, sun_location, rotation=[0,0,0])
    lightObj.set_actor_label("sun")
    #find component
    lightComp = lightObj.light_component
    lightComp.set_editor_property("intensity",5.0)
    
    #check to see if it actually did something
    print lightComp.get_editor_property("intensity")

    Comment


      #3
      I can't resolve
      Code:
      lightComp = lightObj.light_component
      Are you receiving an error on this line?
      Eldridge Felder

      Animation/Visualization Manager
      WorthGroup Architects

      Comment


        #4
        I ran my example code without issues. Maybe remove my "#" comments? Or what code are you running?
        I'm running 4.22.x

        Comment

        Working...
        X