Announcement

Collapse
No announcement yet.

Triggering DataReader

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

  • Triggering DataReader

    Hello All,

    Is there a way to trigger the datareader plugin if you have more than 1 in a scene. Currently I have 2 data readers in a scene and only the first one updates automatically but not the second. Is there a way to trigger that second reader? I tried using the Post action in the first data reader but it did not work.

    Thanks in advance,
    Shotski

  • #2
    Have you tried using an action keyframe , Animated Datareader button or Animated script button?
    Last edited by Novacane89; 08-04-2018, 09:31 PM.

    Comment


    • #3
      Thanks, i forgot about action keyframe but the issue i am having now is using data reader with transition logic. I am using different file names to get data and when i go from scene to scene the filename does not change after the first try because the control parameter is named the same. How do i get the filename of the outgoing scene to clear so the in coming scene starts populating data?

      Comment


      • #4
        I haven't used datareader with transition logic since i normally create my own excel import solutions using c# visual studio with my TL scenes, however i made this script plugin you can try, It basically has a button that would SET the datareader field name to a textDir entered on its own field locally and has a second button that triggers the "Load".

        The plugin has a container field that you can drag your dataReader container into. Animate the Set and then Load buttons (only need one keyframe per button) and see if its changing the datareader field file name... This is just to test your issue, if it works you can expose the directory field of this script with a control parameter plugin or just reference a font with control text.

        Create new container
        Add script Plugin,
        Paste this code.

        '--------------------------------
        sub OnInitParameters()
        RegisterPushButton("SetNewFileName","SetNewFileName",1)
        RegisterParameterContainer("TargetDataReaderContainer","TargetDataReaderContainer")
        RegisterParameterString("filePath","File Path","C:\\data.xlsx",30,100,"")
        RegisterPushButton("DataReaderLOAD","Load Data",2)
        RegisterPlugin("DataReaderPathSetter_And_Loader")
        RegisterInfoText("1-Drag container with datareader into this contaiener slot\n2-Set File Path ***.xlsx\n3-Animate button SetNewFileName and LoadData.\nIf Callup scene for transition logic make sure director name is "Default" where buttons are animated")
        end sub

        sub OnExecAction(buttonId As Integer)

        if buttonId = 1 then
        System.SendCommand("#" & GetParameterContainer("TargetDataReaderContainer").VizId & "*FUNCTION*DataReader*filename SET " & GetParameterString("filePath"))
        elseif buttonId = 2 then
        System.SendCommand("#" & GetParameterContainer("TargetDataReaderContainer").VizId & "*FUNCTION*DataReader*load INVOKE")
        end if
        end sub


        '-------------------------

        Then click "Compile"

        It's a shot in the dark.. but maybe it works lol
        Attached Files
        Last edited by Novacane89; 08-06-2018, 05:07 PM.

        Comment


        • #5
          Thanks so much, I will try this and report back.

          Comment


          • #6
            Hi Novacane,

            The script works but when i run it through transition logic the control parameter is fighting with itself. It seems that it needs to clear itself before the next page comes in. An ideas?

            Thanks,
            Shotski

            Comment


            • #7
              I am also having trouble animating the buttons. Is this the correct scripting:


              MAIN_SCENE*TREE*$reader*SCRIPT*INSTANCE*SetNewFileName INVOKE;

              Comment


              • #8
                Hey Shotski,

                That would be the correct path if the "reader" container was located in the master scene since your command is addressing "MAIN_SCENE", Try "THIS_SCENE" Instead
                Have you tried Dragging the "reader" container to the director so that it creates an animation channel? then right click the animation channel and select the plugin in the dropdown and animate the buttons.

                If this is in a callup scene, Make sure the director name is "Default". I have had action keyframes and script buttons not working on callupscenes until i named it "Default". I am not sure if they fixed it in the later versions...

                You can clear an input field to a control parameter with this command in an action keyframe
                THIS_SCENE*TREE*$ControlParameterContainer*FUNCTION*ControlParameter*input SET

                Hope it works for you, Feel free to post the feedback, I am sure we can create a workaround
                Last edited by Novacane89; 08-07-2018, 06:56 AM.

                Comment


                • #9
                  Thanks for the information. I am animating the buttons as you suggested by dragging the data reader to the stage. It works fine. I will respond if i run into any other issues. Thanks so much again.

                  Shotski

                  Comment


                  • #10
                    Looks like i spoke too soon. I seems that the value in the parameter clears but it does it only for the first entry so the incoming scene gets cleared instead. Is there a way to clear the entry in the parameter per Viz ID? Sometimes transition logic is not a friend. :-(

                    Comment


                    • #11
                      I have attached the scene, It seems that the data reader is not updating fast enough as well. When one scene goes off and the other comes on it does not update until a few seconds after. It takes about 3 seconds from the time it goes off to update. Is there a way to speed that up at all?
                      Attached Files

                      Comment


                      • #12
                        Hey Shotski,

                        My excel expired recently since i changed from full-time employment to Freelance. With my excel in trial mode it will unfortunately not let me do read actions to test your scene until i activate it again, Untill then i guess teamviewer could be a way to look at it... However I created this little rough tool a while ago. Its basically an .exe file i created in visual studio that reads defined cells from an excel sheet and passes it to Viz Shared memory, On each font plugin you then add the fontscript to tell the font which excel datacell to retrieve from shared memory. Its much faster than the dataReader but unfortunately i have not gotten round to polish it yet and add cell ranges and stuff so you need to define each cell you want to get pulled. The instructions are Included in the file and on the plugin , I have not tested this with TL yet neither. Also only tested it with Artist 3.8.3 and 3.9.1

                        Cheers
                        Attached Files

                        Comment


                        • #13
                          Thanks for the info. I can use this set up for another project i am working on. Thanks. I will need to see if i can change the animation to compensate for the 3 second delay. Wish me luck.

                          Shotski

                          Comment

                          Working...
                          X