Graphics

 View Only
  • 1.  Copying content from object to object

    Posted 12-06-2012 04:27
    Hello,

    I've been using scripting to copy the text from one text object to another for use in conditional scene groups. So, the existence of text in a published field determines which scene group is visible. The script copies the text field to a text object in the other scene group so it doesn't have to be typed twice by the news person.

    I'm using the following scripit as an example:

    dim text1 as xptextobject

    dim text2 as xptextobject

    selfgetobjectbyname "line 1", (text1)

    selfgetobjectbyname "line 2", (text2)

    text2.text = text1.text

    This is all working just fine. Now, however, what do I do when I want to use that same idea with an image? The news person selects an image file for a published quad object. I want whatever is in that field to be copied to another object's material. I'm not sure what to put in the script for that.

    Thanks for any help!


  • 2.  RE: Copying content from object to object

    Posted 12-06-2012 09:36
    No need of script for that... Apply the same material to both quad...

    #XPression


  • 3.  RE: Copying content from object to object

    Posted 12-07-2012 01:07
    I may not have explained well. The material is being supplied by the ActiveX plugin through the iNews script. Because the image is dynamic, I can't apply the material to the second image until the first image is selected by the producer, so I need a script to get the material being supplied and make it the material for the second image. The material will be an image file located on a shared drive.

    #XPression


  • 4.  RE: Copying content from object to object

    Posted 12-07-2012 09:54
    I really sorry but I don't understand what you want to do...

    In the same scene, you have 2 quad. You want to update this 2 quad in order to obtain the same image in both of them. When quad 1 is updated by activeX, you want the quad 2 to update automatically with the same content of quad 1. Is it right ?

    If yes, my first solution is the best : same material for 2 quad

    #XPression


  • 5.  RE: Copying content from object to object

    Posted 12-08-2012 03:39
    Here is an example script that should do what you want.. Just edit the object names as appropriate for your scene.



    Dim LeftOTSMat as xpMaterial

    Dim RightOTSMat as xpMaterial

    Dim LeftQuad as xpBaseObject

    Dim RightQuad as xpBaseObject

    Dim LeftOTSTxt as xpTextObject

    Dim RightOTSTxt as xpTextObject

    Self.GetObjectByName("Left Pic", LeftQuad)

    Self.GetObjectByName("Right Pic", RightQuad)

    Self.GetObjectByName("Left OTS Text", LeftOTSTxt)

    Self.GetObjectByName("Right OTS Text", RightOTSTxt)

    LeftQuad.GetMaterial(0, LeftOTSMat)

    RightQuad.SetMaterial(0, LeftOTSMat)

    RightOTSTxt.Text = LeftOTSTxt.Text



    #XPression