Graphics

 View Only
  • 1.  compare datalinq fields

    Posted 06-11-2015 10:48
    Is it possible to compare some datalinq fields with numbers in from an xml file and by the numbers size change wich animation controller I use on the group the field ar placed in?

    Somebody tried that?


  • 2.  RE: compare datalinq fields

    Posted 06-11-2015 14:07
    Yes, you can use an OnOnline script to compare the two text objects that are datalinqed to the values. This is done exactly the same way whether the text objects are datalinq'd or static text. When the scene is prepared and goes online, the text objects have already been updated with data before the OnOnline script is run.

    #XPression


  • 3.  RE: compare datalinq fields

    Posted 06-17-2015 00:44
    I think I now how to do, but I need a litte help with some code that can compare, lets say 3 numbers and find largest number.

    #XPression


  • 4.  RE: compare datalinq fields

    Posted 06-17-2015 01:00
    `dim x,y,z as xpTextObject

    dim max as xpTextObject

    dim maxval as Integer

    self.GetObjectByName("Text1", x)

    self.GetObjectByName("Text2", y)

    self.GetObjectByName("Text3", z)

    self.GetObjectByName("Max", max)

    maxval = CInt(x.Text)

    if CInt(y.Text) > maxval then

    maxval = CInt(y.text)

    end if

    if CInt(z.Text) > maxval then

    maxval = CInt(z.text)

    end if

    max.text = "The largest number is " + maxval.ToString

    `

    #XPression


  • 5.  RE: compare datalinq fields

    Posted 06-17-2015 01:04
    If you want to do more complex sorting; I have an example I made a long time ago that reads values from datalinq and sorts them then generates an animation on the fly to animate them into their correct sorted order..

    It's a bit complicated to set up but here it is: https://ross.brickftp.com/f/c7f2cec1a

    Just unpack it and load the DSC file into datalinq server and point the datalinq to wherever you put the .TXT file.

    Then put the scene online from the sequencer.. You can then edit the data in the text file, save it, and resume the Pause on the sequencer item and the order should re-animate to the new sorted order.

    You'll find the script on the scene director that performs the sorting and generates the animation keyframes.

    Its basically loops over all of the text objects to find the one with the highest value; then loops again to find the next highest, etc, until it has found them all in descending order. As it loops, it assigns keyframes to an animation controller. At the end of all the looping it plays the animation controller.

    #XPression


  • 6.  RE: compare datalinq fields

    Posted 06-17-2015 01:45
    Brian! What a great effect. Thank you so much for posting the project. VERY USEFUL! I know I will use it in the future! Thanks Again!

    #XPression


  • 7.  RE: compare datalinq fields

    Posted 09-20-2016 09:35
    Any chance you still have that project @bford ?
    I'm trying to position 10 elements based on the value of the associated text objects.
    #XPression


  • 8.  RE: compare datalinq fields

    Posted 09-21-2016 01:06