Graphics

 View Only
  • 1.  Reflection

    Posted 01-29-2013 14:55
    Hi all,

    I'd like to have a reflection of object A (say a picture) appear in object B (lets say: a floor) without having to assign 2 separate materials in the sequencer.

    Now in a scene there are two methods in which this is fairly easy to do.

    Methode 1. Creating a renderview of the picture and map that on the floor mirrored by setting the correct texture coordinates

    That's all fine, but here is the thing: this only works in the original scene. When I go into the sequencer and load a different image for the picture, the reflection remains the same old image assigned in the original scene. Apparently the renderview points to the original scene and not the copy used in the sequencer, so this won't work.

    Methode 2. Map the same material of the picture on the floor mirrored by setting the correct texture coordinates. Again: this only works in the original scene. When I go to the seqencer I have to assign a new image to both objects: to the picture as well as to the floor, but that's not what want: I just want to assign one image to avoid errors by the operators when they assign the image for one object but forget the other.

    Is there a way to achieve what I want without the use of the API (I know how to solve this using the API, but I want to build it in XPression self without the use of the API)? I am curious to your ideas.

    Kind regards,

    Gerard


  • 2.  RE: Reflection

    Posted 01-29-2013 22:03
    Hi Gerard,

    I've had the same issue before and I ended up doing it through the API because other methods were not working for me.

    I've tried it with the Reflection Map-material but without any luck.

    I guess it would be possible to use scripting inside Xpression although I have never tried it.

    Regards,

    Kenneth

    #XPression


  • 3.  RE: Reflection

    Posted 01-29-2013 22:06
    You can run a very simple script onOnline and onPreviewRender that will copy the material from the top object to the bottom object, which bypasses the need for a render view and in my opinion is a much more efficient solution.

    Here is the script I used,

    dim pic as xpBaseObject

    dim reflect as xpBaseObject

    dim copymat as xpMaterial

    Self.GetObjectByName("picture", pic)

    Self.GetObjectByName("reflection", reflect)

    pic.GetMaterial(0, copymat)

    reflect.SetMaterial(0, copymat)

    just replace the items in quotes with your object names.

    Andrew

    #XPression


  • 4.  RE: Reflection

    Posted 01-30-2013 08:48
    @Andrew: I tried your script and it worked for the onOnline (I completely forgot about the existence GetMaterial and SetMaterial methods), but not for the onPreviewRender. The preview output just shows the scene with a new image in picture (as expected), but with the original image still in reflect. Since I wasn't using the last build for the test, I installed V4.3 build 2240, but this had the same result.

    A colleague of mine (who is actually working on the project) contacted Ross Support by email for the reflection issue and got the same response from you as I did. However you send him a short instruction video and a sample project as well, so I tried that sample project: same result ... onOnline works fine, but the onRenderPreview doesn't.

    In your instruction video I noticed that you are using some exotic XPression version/build (V4.11 build 1009). Any chance that the onRenderPreview has been fixed there, but that it hasn't been released yet in the nightly builds?

    Regards,

    Gerard

    #XPression


  • 5.  RE: Reflection

    Posted 01-30-2013 09:52
    An update to the findings above:

    The onRenderPreview in the preview window of the sequencer does work, as well as on a preview rendered to an actual video output. However, when the preview is rendered to a virtual framebuffer (which I used for testing) onRenderPreview doesn't work.

    #XPression


  • 6.  RE: Reflection

    Posted 01-30-2013 13:29
    I don't know why it's not working in your version this is a method I have used for a long time back to early 4.0 builds. Let me try a few different versions to see if I can find where it stopped working.

    Andrew

    #XPression


  • 7.  RE: Reflection

    Posted 01-30-2013 13:46
    So I tried my project in 4.0 2025 and also 4.3 2240 and it works perfectly in both. any chance there is a typo in your on preview script?

    Andrew

    #XPression


  • 8.  RE: Reflection

    Posted 01-30-2013 14:05
    I used your project without changing the code and it didn't work.

    I'm using XPression Developer, so just to be sure I just tested it on XPression Studio as well and I have the same problem: the onRenderPreview-script does work on an actual video output and in the preview window of the sequencer, but when I use a Virtual Output as preview it doesn't work (even though I see the correct image in the preview window of the sequencer simultaneously).

    #XPression