Graphics

 View Only
Expand all | Collapse all

Scripting Action embedded into hotkey to toggle object visibility in active scene in layout

  • 1.  Scripting Action embedded into hotkey to toggle object visibility in active scene in layout

    Posted 02-10-2021 19:43

    Hello,

    I'm looking for simple scripting that can be assigned a hot key to do the following on the active scene in layout mode:

    Toggle on/off a specific object in object manager by object/node name (GRID)

    So when the hot key is pressed, it should turn visibility on/off on GRID node in current scene, based on current state.

    I'm assuming this is very simple, but my API/scripting knowledge is less than basic.

    Thanks in advance.



  • 2.  RE: Scripting Action embedded into hotkey to toggle object visibility in active scene in layout

    Posted 03-19-2021 12:04

    You'll need to put something like this on a keybind. 

    dim channel as xpOutputFrameBuffer
    dim scene as xpScene
    dim sphere as xpBaseObject


    Engine.GetOutputFrameBuffer(0,channel)
    channel.GetSceneOnLayer(0, scene)
    Scene.GetObjectByName("Sphere1", sphere)


    if sphere.Visible=False then
    sphere.Visible=True
    else
    sphere.Visible=False
    end if


    #XPression