No announcement yet.

Display a static or skeletal mesh?

  • Filter
  • Time
  • Show
Clear All
new posts

    Display a static or skeletal mesh?

    I would like to display a rotating gun in my inventory screen. Is this at all possible?

    I suppose could just record a movie of the gun and play that... or put the gun in the actual world and line it up with the UI... but I was hoping there'd be some way of actually displaying custom 3D content inside scaleform.

    You can't display actual 3D content inside GFx; however, you can place the gun in the level somewhere (perhaps in a room that is out of site) and use a scene capture actor to record the rotating gun. Then you can use that scene capture actor to render the movie of the rotating gun as a texture in the Flash file.

    Your other option would be to render out the gun as a png image sequence, then import those into Flash and animate them on the timeline. This has the benefit of allowing you to alpha out the areas around the gun in Photoshop. I'm not sure if you can capture the gun in the level using scene capture actor without also capturing the level behind it.


      Nice. Thats crafty


        Here is a basic setup for capturing a 3D mesh from the game and rendering it to Flash with a scene capture actor:

        NOTE: You must be using at least the May 2012 version of UDK for this to work.

        See a video tutorial of this feature here.


        var TextureRenderTarget2D MyRenderTexture;
        function SetRenderTexture()
        Replace 'MyPackageName' with the actual package name where the render target 2D texture lives in UDK.


        import flash.external.ExternalInterface;"SetRenderTexture");
        The Flash file would have a movieclip in it. Give that movie clip an instance name of: MyRenderTarget_mc. That movieclip should contain a PNG file - any image will do as it will be replaced. The PNG will end up being replaced by the render texture from Unreal.

        Right click the PNG file in the library panel. It should have its linkage setup to 'Export for ActionScript' and 'Export in frame 1'.

        If Using ActionScript 2.0

        The Identifier for this texture should be: MyRenderTarget.

        If Using ActionScript 3.0

        The Class field should be: MyRenderTarget. Base class should be: flash.display.BitmapData (this will be automatically filled for you by Flash).


        In your level, you would set up a SceneCapture2DActor and point it at your object. Create a new TextureRenderTarget2D in the Content Browser and name it MyRenderTexture. Select the new render texture, then go into the Texture Target field of the SceneCapture2DActor's properties, and insert: TextureRenderTarget2D'MyPackageName.MyRenderTextur e' by pressing the green arrow.


          That is extremely helpful. Thank you very much!


            Dynamic Scene Capture Actor. Possible?

            So is it also possible to put a scene capture actor directly in front of the main character and attach so that it follows the main character around, so that you can have an interactive equipable character like that in The Elder Scrolls: Oblivion? This is one of my goals.



              I'm sure it is, but that's not a Scaleform specific thing. Couldn't tell you exactly how to do it, as I've not tried it myself.


                Yeah, it's possible. All you need to do is attach the capture actor to the player and you are good to go. The capture actor is a camera so it can be dynamic and moved just as any other dynamic actor can.


                  i got this working so that i can have characters faces on the ui for talking sequances. it works fine apart form the image itself on the hud is very see through and doesnt just give an exact picture of the camera view. i cant figure out why, or what settings are affecting this exactly.

                  the way i have it set up there is some geometry with the material on which shows the 2dcapture footage, and the hud should show exactly the same thing. the geometry one works perfectly well.

                  edit: also on a side note, is it possible to put a material which uses this render texture onto the hud, so far ive only managed it with the rendertexture but it doesnt like the cast to material.


                    the image itself on the hud is very see through
                    I believe there is a work-around for this transparency issue:
                    1. Select the movie clip containing the texture to be replaced by the SceneCapture2DActor image.
                    2. Set the Color Effect to Advanced.
                    3. Set Alpha (xA +) to 255
                    4. Save, Publish, and Reimport.


                      thank you worked quite well. i thought it was something to do with my properties in udk itself i may have missed.


                        any idea if its possible to use a material insteda of texture on the scaleform HUD? the way i was thinking was doing the animations in flash for the hud but if i could use a material it would be alot simpler.


                          Thats a good question - one I don't know the answer to. I'm not entirely sure if you could use SetExternalTexture to display a material, but I'd say just try it out and see what happens.


                            What I wonder is if it's possible to use the thumbnails that the editor uses of actors. They aren't 3d or animated, but similar. Also this method requires each map to have a special "inventory area", might there be a way around this?


                              Originally posted by Matt Doyle View Post
                              Thats a good question - one I don't know the answer to. I'm not entirely sure if you could use SetExternalTexture to display a material, but I'd say just try it out and see what happens.
                              Hi Matt!

                              I can't use SetExternalTexture with Material. Do you know another way to remove the background from TextureRenderTarget2D like color key or chroma

                              I want to show my character on inventory without "black" background.