Graphics

 View Only
Expand all | Collapse all

Cannot Set Positioner Position Values

  • 1.  Cannot Set Positioner Position Values

    Posted 10-31-2022 17:56
    Hello,

    I am trying to write the following keyboard script that changes the position of a scene. I can successfully locate the scene and get the XYZ positions from it, but I cannot set the values. Interestingly, when I test the script, it returns that the value has been updated, but the preview window or the values in the editor do not reflect that.
    Both the .PosY and the .SetPosXYZ do nothing apparently. The commented is what I hope to achieve, toggling between the two values for the scene.
    dim positioner as xpBaseObject
    dim hold as xpScene
    dim xInit, yInit, zInit as double
    
    engine.GetSceneByID(9535,hold)
    hold.GetObjectByName("Positioner",positioner)
    positioner.SetPosXYZ(640.0, 320.0, 0.0)
    positioner.PosY = 320.0
    
    
    
    'if yInit = 360 then
    'positioner.SetPosXYZ(640.0,320.0,0.0)
    'else if yInit = 320 then
    'positioner.SetPosXYZ(640.0,360.0,0.0)
    'else
    'positioner.SetPosXYZ(640.0,360.0,0.0)
    'end if​
    EditorThe object I am trying to modify is the highlighted positioner object. Any help would be appreciated, thank you!


    ------------------------------
    Jack Reynolds
    ------------------------------


  • 2.  RE: Cannot Set Positioner Position Values

    Posted 11-01-2022 05:40
    Hi Jack.
    First: I noticed that the work of the script is distributed only in this scene. Then why are you declaring this scene in a script?
    Second: engine.GetSceneByID(9535,hold) is written incorrectly, the third parameter is missing, true or false
    Third: why reapply the Y position
    positioner.SetPosXYZ(640.0, 320.0, 0.0)
    positioner.PosY = 320.0
    dim positioner as xpBaseObject
    
    scene.GetObjectByName("Positioner",positioner)
    positioner.PosY = 320.0
    

    In general, it would be better if you described the task in full


    ------------------------------
    Roman Yaroshenko
    chief specialist
    RBC-TV
    Moscow Russian Federation
    ------------------------------



  • 3.  RE: Cannot Set Positioner Position Values

    Posted 11-01-2022 10:23
    Thank you for your replay. I am trying to make a keyboard script that toggles that specific scene's positioner object between Y320.0 and Y360.0. The challenge is this script has to be a keyboard script that modifies this value, as we cannot edit the scene itself to add a function that allows for position changing. The script I wrote functions correctly according to the debug. When I do a .GetPosXYZ, it returns the initial value. After I set new values to it and run another get, it returns that those values are then newly written ones. However they do not appear to make it to the actual scenes.

    Thank you,
    Jack

    ------------------------------
    Jack Reynolds
    ------------------------------



  • 4.  RE: Cannot Set Positioner Position Values

    Posted 11-01-2022 10:44
    ОК.
    Where do you set your script and from where are you running your scene, from layout or from Sequence

    ------------------------------
    Roman Yaroshenko
    chief specialist
    RBC-TV
    Moscow Russian Federation
    ------------------------------



  • 5.  RE: Cannot Set Positioner Position Values

    Posted 11-01-2022 10:51
    I am running the script from the Keyboard/GPI Mapping menu globally, using the OnKeyPress. I am running it from the sequencer. Though, when I try to run the command in the layout it exhibits the same behavior.

    ------------------------------
    Jack Reynolds
    ------------------------------



  • 6.  RE: Cannot Set Positioner Position Values

    Posted 11-01-2022 11:49
    Here is a script. In a string fb.GetSCeneOnLayer(0, fb) you must set the number of layer were you are running the scene. 
            Dim positioner As xpBaseObject
            Dim hold As xpScene
            Dim fb As xpOutputFrameBuffer
    
            engine.GetOutputFrameBuffer(0, fb)
            fb.GetSceneOnLayer(0, hold)
            hold.GetObjectByName("Positioner", positioner)
    
            positioner.PosY = 320.0​


    ------------------------------
    Roman Yaroshenko
    chief specialist
    RBC-TV
    Moscow Russian Federation
    ------------------------------



  • 7.  RE: Cannot Set Positioner Position Values

    Posted 11-02-2022 10:44
    I just tested that script and it does not seem to do anything. I ran it on the correct FB and layer, and nothing changes on the output or in the preview. Checking the layout confirms that the value is unchanged.

    ------------------------------
    Jack Reynolds
    ------------------------------



  • 8.  RE: Cannot Set Positioner Position Values

    Posted 11-02-2022 11:23
      |   view attached
    Hi Jack.
    Have you created  two hotkeys with two scripts?
    Put main.kbd into XPression program folder. Run Xpression,  open Keyboard/GPI Mapping and in Current keyboard Map select main.
    After that run the scene and press 1 then 7 on numpad
    ------------------------------
    Roman Yaroshenko
    chief specialist
    RBC-TV
    Moscow Russian Federation
    ------------------------------

    Attachment(s)

    xpf
    teeest.xpf   28 KB 1 version


  • 9.  RE: Cannot Set Positioner Position Values

    Posted 11-02-2022 11:27
      |   view attached
    rename in main.kbd

    ------------------------------
    Roman Yaroshenko
    chief specialist
    RBC-TV
    Moscow Russian Federation
    ------------------------------

    Attachment(s)

    txt
    main.txt   75 KB 1 version


  • 10.  RE: Cannot Set Positioner Position Values

    Posted 11-02-2022 11:41
    I put your script into the keyboard file and did not have success. As I said in my original post, the script will run with no issues, but it cannot write values. The script you provided me did run, but it had the same issue as I did, where it will not modify any values.

    ------------------------------
    Jack Reynolds
    ------------------------------



  • 11.  RE: Cannot Set Positioner Position Values

    Posted 11-02-2022 11:57
    OK.
    What values do you want to write and where?

    ------------------------------
    Roman Yaroshenko
    chief specialist
    RBC-TV
    Moscow Russian Federation
    ------------------------------



  • 12.  RE: Cannot Set Positioner Position Values

    Posted 11-02-2022 12:13
    The screenshots are all in my original message, but I want to write Y-Pos = 320 into the positioner object in my scene 9535. The screenshot of the scene objects is above.

    ------------------------------
    Jack Reynolds
    ------------------------------



  • 13.  RE: Cannot Set Positioner Position Values

    Posted 11-02-2022 14:25
    Do I understand correctly what you want to see how the Y-Pos changes after you click the button, even if you run scene in Sequencer?

    ------------------------------
    Roman Yaroshenko
    chief specialist
    RBC-TV
    Moscow Russian Federation
    ------------------------------



  • 14.  RE: Cannot Set Positioner Position Values

    Ross Staff
    Posted 11-02-2022 17:18
    I tested Roma's script in the Keyboard Map Script OnKeyPress event and it works for me. I put the scene online on Framebuffer 1 layer 0 with an object called "Positioner" and when I execute the keyboard macro it moves the Y position of the object to 320 while online. 

            Dim positioner As xpBaseObject
            Dim hold As xpScene
            Dim fb As xpOutputFrameBuffer
    
            engine.GetOutputFrameBuffer(0, fb)
            fb.GetSceneOnLayer(0, hold)
            hold.GetObjectByName("Positioner", positioner)
    
            positioner.PosY = 320.0​


    Its important to be aware that when a scene is online in the Sequencer or preview that it is a copy of the original scene, is it not the scene itself. In your original script, Jack, you call:

    engine.GetSceneByID(9535,hold)


    That call will not affect an online scene or a scene in preview, because those are scene copies, not the scene. That's why Roma's script calls

     fb.GetSceneOnLayer(0, hold)

    Which would retrieve the scene copy. 

    Are you trying to make the object move while it is online in a framebuffer or while it is in the viewport of XPression? 




  • 15.  RE: Cannot Set Positioner Position Values

    Posted 11-05-2022 00:27

    I was trying to make it move while it was in the viewport. Either way, we were able to get this scene corrected from the maker, eliminating the need for this script.

    Thanks,

    Jack



    ------------------------------
    Jack Reynolds
    ------------------------------