Tuesday, May 18, 2010

Classes and subclasses

I have been trying to wrap my head around the classes and functions in Unrealscripting. Unfortunately alot of the aid online is very game centric and not Editor centric. One of the main problems I am running into is the replicating the functionality of the ActorFactoryStaticMesh class or StaticMeshActor class. When you right click on the viewport in the UnrealEd, you are able to add the selected mesh in the Content Browser. However, trying to write a script to allow the same functionality but mulitple times seems rather problematic. I am have been unsuccessful in finding the code or the methods used for simulating the same functionality as the Add StaticMesh or Add Selected Mesh.

All of the methods I have seen for replicating StaticMeshes has been during gameplay. So its quite possible accomplish the task but only during gameplay. This negates the functionality of pre calculated lighting since the meshes would only be spawned when the game starts.

Thursday, May 13, 2010

Re-assembling FBX imports

At the moment I am working on a script that would allow the reassembling of the static meshes imported into UnrealED to alleviate manually reassembling of scenes created in Maya. This may also be applicable to other 3D programs that export using the FBX format.

The approach that I am currently undertaking are
  1. Importing static meshes at location 0,0,0. When a static mesh is added to the scene in the UnrealED, location 0,0,0 for the static mesh that is being add is the point at which you right click to add the static mesh. Since this point is not actually location 0,0,0 the static mesh that is added would be relative to this point. In order to correct this you must manually set the location of the added mesh to location 0,0,0. So the first purpose of the script is to move the added static mesh to location 0,0,0.
  2. Duplicating static meshes. Once I am able to successfully duplicate static meshes in script, I would then be able to create and indefinite amount of static mesh using a for loop.
  3. Create a list of static mesh locations from the selected mesh in the content browser. This list would then be used to replace the meshes that are being duplicated in the preceding for loop.

Some of the classes that would be examined to accomplish some of these features are the functions found in the Actor class for movement and relocation, StaticMeshComponent class for the replacing of static meshes in the for loop and the ThumbnailRenderer, ThumbnailManager etc for creating a list of the static mesh locations.

The current hurdle that I am facing is using the SetLocation function that is native to the Actor class on the active or currently selected static mesh actor that is being added to the scene.

Tuesday, May 4, 2010


These are some the stuff I learnt in the process of importing assets into the Unreal Editor:-
  • When exporting selection using FBX its important to delete history or the FBX plugin would export the entire scene.
  • When placing objects into the scene in Unreal Editor its best to place the object from the top view. It aligns the object relative to the location in my on the Y axis.
  • Re-importing meshes require importing the mesh again instead of using the re-import option in the Content Browser.
  • Re-use UVs for lightmap by changing the Light Map Coordinate Index to 0 instead of 1.

The screenshot above is using one Dominant light with lightmass to generate the indirect lighting. The lightmaps for the scene varies depending on the size of the mesh. The largest lightmap in use in this shot is 1024.