redmotion: June 2007

29 June 2007

Sun position for XSI 6 - beta

Please download this plugin for XSI 6+ from here.


Read the instructions in the readme file for installation and usage.

Residential Building 1 (reprise)

Yep. Rendered in Mental Ray in just under two hours at 2000 pix wide and tweaked in Photoshop comes my redo of the Residential Building 1 image:

Both images can be found at my portfolio at CGTalk - http://jasonio.cgsociety.org/gallery/

15 June 2007

T-Gen for Softimage XSI - public beta





This is a plug in I've been lucky enough to have been a beta tester on for the last week or two.

What is it? To quote the T-Gen website:

T-Gen is the first tree and plant generator plugin fully integrated into XSI architecture. Over 100 appearance and distribution parameters, full utilization of XSI curves and node-based hierarchy ensures great flexibility and huge possibilities while creating your own trees and plants. You can use almost all XSI tools to additionally edit materials, geometry, hierarchy of all T-Gen objects. With powerful optimization tools you can create low-poly trees and plants for your games. Almost all parameters of T-Gen are animatable, so you can create animations of growing trees and plants.



12 June 2007

Auto-rendermap script (XSI)

Here is a short script for automating the UV-mapping and rendermapping of any polymesh objects you have selected. Change the parts highlighted in red if you want better resolution textures to be generated (eg:512 to 1024). You can also add further rendermap options here like to render illumination only. The line in green is where the UVs are applied. This can be amended to suit various situations.

All rendermaps are automatically saved out to your project/Rendermaps directory.

Once rendermapping is complete, constant shaders are then applied to all the objects and the textures are reattached to the correct objects automatically.

Switch to textured decal in the viewport to see the result.

(Save a copy of the scene before continuing and use at your own risk)

'Make a rendermap on every selected object in scene

'completed between 10 & 11-06-07
'By Jason Wells aka Redmotion

dim name, imfile, oClip

set list = GetValue( "SelectionList" )
if list.count = 0 then
MsgBox "Please select at least one polymesh object first!!"
else

'start rendermap make routine - depending on scene size and object complexity this could take a while... :)
for each item in list
logmessage item.name
name = item.name
if item.type = "polymsh" then
SelectObj name, , True
'set up unique UVs with name starting with RM_
oUVs = GenerateUniqueUVs (, "RM_" & name)

AddProp "RenderMap"
SetValue name & ".RenderMap.imagefilepath", "Render_Pictures\RM_" & name & ".pic"
SetInstanceDataValue , name & ".RenderMap.uvprop", "RM_" & name

SetValue name & ".polymsh.cls.Texture_Coordinates_AUTO.RM_"& name &".PolyPackUV.targresv", 512
SetValue name & ".polymsh.cls.Texture_Coordinates_AUTO.RM_"& name &".PolyPackUV.targresu", 512
SetValue name & ".RenderMap.resolutionx", "512"
SetValue name & ".RenderMap.squaretex", True

logmessage "RENDERMAP generation starts for: " & item.name & " - please wait"
RegenerateMaps name & ".RenderMap"
logmessage "RENDERMAP generation complete!"
end if
next

'change the shaders for selected objects to constants and add RM_image
for each item in list
name = item.name
if item.type = "polymsh" then
SelectObj name, , True

'bring in all rendermap clips
imfile = "Render_Pictures\RM_" & name & ".pic"

oClip = "Clips.RM_" & name & "_pic"

ApplyShader "Material\Constant", , , , siLetLocalMaterialsOverlap
CopyPaste , imfile, "TransientObjectContainer", 1
SIConnectShaderToCnxPoint oClip, ".material.Constant.color", False
SetInstanceDataValue , ".material.Constant.Image.tspace_id", "RM_" & name
end if
next
DeselectAll

end if

Exporting directx files to Dark Basic Pro from XSI




Exporting environments as direct x files to Dark Basic Pro from Softimage XSI isn't that straightforward. But perfect results are possible:-

1. Make your scene, texture and lightmap as required.
2. Save the scene before continuing. Now flip the entire scene as follows:-
- create a primitive > polygon > cube
- make the cube the parent of all polygon scene elements
- scale the cubes Local Z scaling to -1 (flipping the scene) (EDIT: changed from X to Z)
- in explorer, drag all the scene objects back to the scene root
- delete the cube
- select all the scene objects and freeze all transforms



- export using the settings in the image below:


Tip1: Always export to the game directory. XSI will copy and convert all textures in the scene and place them here.
Tip2: Unless there are animated objects in the scene, uncheck export animation otherwise it will crash (and vice versa).
Tip3: Animation Type: Matrix Keys are bone based animation
Tip4: Animation Type: SRT are scale/rotate/transform animations (good for platforms)
Tip5: Complex character rigs will cause crashes. Use the simplest possible rigs for exporting.
Tip6: You can choose shrink textures or choose alternative formats.
3. You will now have a directx file and a series of .jpeg textures in your game directory.
4. Go to your art program (Photoshop or Gimp, whatever) and load up, flip horizontally and save all the scene textures.
5. Go to DBPro and run your model loader code: