Talk:Mod Tool/OniTools addon
More wild ideas
Animated reference
Every step on the timeline triggers an event, namely siOnTimeChangeEvent.
It could be used to exchange an the image of an object.
This could be either good for an animated textures (BINA3RAPd*.oni) or for an animated reference for TRAM creation.
Strategy:
- Making a folder named "Animated_Ref".
- Drag and drop the folder into Mod Tool.
- A grid becomes created on a new layer "Animated_Ref". Selection disabled.
- Mod Tool gets then the first image and looks for the pixels.
- Based on that pixels the grids becomes deformed to match the image's proportions.
- Then this "Animated_Ref" grid should be ready for usage.
Similar can be done with the Rotoscope.
Something like that:
function siOnTimeChangeEvent_OnEvent( in_ctxt ) ' fixed code 'SetValue "Views.ViewD.RightCamera.camdisp.rotoenable", True 'SetValue "Views.ViewD.RightCamera.rotoscope.imagename", "Clips.Animated_Ref_N_jpg" ' flexible code ' find active viewport, set Rotoscope active and choose image 'SetValue GetViewCamera(GetViewIndex) & ".camdisp.rotoenable", True 'SetValue GetViewCamera(GetViewIndex) & ".rotoscope.imagename", "Clips.Animated_Ref_N_jpg" current_frame = cstr(in_ctxt.GetAttribute("Frame")) if GetValue(GetViewCamera(GetViewIndex) & ".camdisp.rotoenable") = true then ' Animated_Ref_60.jpg ' . becomes _ SetValue GetViewCamera(GetViewIndex) & ".rotoscope.imagename", "Clips.Animated_Ref_" & current_frame & "_jpg" end if siOnTimeChangeEvent_OnEvent = true end function
New camera animations
last frame of OBANOutroCam02 |
There's already an excel macro available but now I want to build cam anims without excel.
The last frame's rotation of level1_Final file OBANOutroCam02 is: -0.0158410165 0.854542 0.0261086561 -0.518483639.
Those quaternions are sorted in X Y Z -W order, so we've to watch out a bit when setting the input for converting them to euler rotations in degrees.
If a newly created object (in this case a cube) shall serve as camera placeholder then the X output has to be multiplied by -1 and the Y output has to be reduced by -180. Those changes must repeated again when exporting the object's rotation to xml.
Update: Sept. 29, 2012
If camera is a real one then the additional X and Y changes aren't necessary. (Primitive > Camera > any should do)
Positions and rotations keyframes can be applied to the camera root object.
Adding multiple textures to level geometry
Material and textures are normally stored right under the object. But AKEV geometry can have more than one texture. Here comes polygon clusters in to play.
An example:
set oCube = Application.ActiveProject.ActiveScene.Root.AddGeometry("Cube","MeshSurface") SelectObj "cube", , True SelectGeometryComponents "cube.poly[LAST]" CreateCluster AddToCluster "cube.polymsh.cls.Polygon, cube.poly[2-4]" RemoveFromCluster "cube.polymsh.cls.Polygon, cube.poly[3]"
The cube has now a polygon cluster. More can be added. Each cluster must get its own material before a texture can be applied to the desired polygons.
[...]
TRBS-fitting TRMA creation
With the following code ...
One more idea is to add support for reflective textures.
|
hexhound hierarchy |
if selection.count > 0 then ' any part could be selected, let's find the root body part SelectNeighborObj selection(0), 4 ' get all members including the pelvis set bodyparts = selection(0).FindChildren( , , siMeshFamily) for each member in bodyparts logmessage "object name: " & member.name if not typename(member.Material.CurrentImageClip) = "Nothing" then logmessage "texture: " & member.Material.CurrentImageClip.source.filename.value 'logmessage "material: " & member.Material.name 'logmessage "shader: " & member.Material.shaders(0).name logmessage "X: " & member.Material.CurrentImageClip.source.Parameters("XRes").Value logmessage "Y: " & member.Material.CurrentImageClip.source.Parameters("YRes").Value end if logmessage "----------------------------------------------------------" next logmessage "counted body parts: " & bodyparts.count else logmessage "no object was selected" end if
' INFO : object name: A ' INFO : texture: C:\Users\RRM\Desktop\A.tga ' INFO : X: 512 ' INFO : Y: 512 ' INFO : ---------------------------------------------------------- ' INFO : object name: R ' INFO : texture: C:\Users\RRM\Desktop\R.tga ' INFO : X: 512 ' INFO : Y: 512 ' INFO : ---------------------------------------------------------- ' INFO : object name: S ' INFO : texture: C:\Users\RRM\Desktop\S.tga ' INFO : X: 512 ' INFO : Y: 512 ' INFO : ---------------------------------------------------------- ' INFO : object name: P ' INFO : texture: C:\Users\RRM\Desktop\P.tga ' INFO : X: 512 ' INFO : Y: 512 ' INFO : ---------------------------------------------------------- ' INFO : object name: Q ' INFO : texture: C:\Users\RRM\Desktop\Q.tga ' INFO : X: 512 ' INFO : Y: 512 ' INFO : ---------------------------------------------------------- ' INFO : object name: N ' INFO : texture: C:\Users\RRM\Desktop\N.tga ' INFO : X: 512 ' INFO : Y: 512 ' INFO : ---------------------------------------------------------- ' INFO : object name: O ' INFO : texture: C:\Users\RRM\Desktop\O.tga ' INFO : X: 512 ' INFO : Y: 512 ' INFO : ---------------------------------------------------------- ' INFO : object name: L ' INFO : texture: C:\Users\RRM\Desktop\L.tga ' INFO : X: 512 ' INFO : Y: 512 ' INFO : ---------------------------------------------------------- ' INFO : object name: M ' INFO : texture: C:\Users\RRM\Desktop\M.tga ' INFO : X: 512 ' INFO : Y: 512 ' INFO : ---------------------------------------------------------- ' INFO : object name: B ' INFO : texture: C:\Users\RRM\Desktop\B.tga ' INFO : X: 512 ' INFO : Y: 512 ' INFO : ---------------------------------------------------------- ' INFO : object name: C ' INFO : texture: C:\Users\RRM\Desktop\C.tga ' INFO : X: 512 ' INFO : Y: 512 ' INFO : ---------------------------------------------------------- ' INFO : object name: D ' INFO : texture: C:\Users\RRM\Desktop\D.tga ' INFO : X: 512 ' INFO : Y: 512 ' INFO : ---------------------------------------------------------- ' INFO : object name: E ' INFO : texture: C:\Users\RRM\Desktop\E.tga ' INFO : X: 512 ' INFO : Y: 512 ' INFO : ---------------------------------------------------------- ' INFO : object name: F ' INFO : texture: C:\Users\RRM\Desktop\F.tga ' INFO : X: 512 ' INFO : Y: 512 ' INFO : ---------------------------------------------------------- ' INFO : object name: G ' INFO : texture: C:\Users\RRM\Desktop\G.tga ' INFO : X: 512 ' INFO : Y: 512 ' INFO : ---------------------------------------------------------- ' INFO : object name: H ' INFO : texture: C:\Users\RRM\Desktop\H.tga ' INFO : X: 512 ' INFO : Y: 512 ' INFO : ---------------------------------------------------------- ' INFO : object name: I ' INFO : texture: C:\Users\RRM\Desktop\I.tga ' INFO : X: 512 ' INFO : Y: 512 ' INFO : ---------------------------------------------------------- ' INFO : object name: J ' INFO : texture: C:\Users\RRM\Desktop\J.tga ' INFO : X: 512 ' INFO : Y: 512 ' INFO : ---------------------------------------------------------- ' INFO : object name: K ' INFO : texture: C:\Users\RRM\Desktop\K.tga ' INFO : X: 512 ' INFO : Y: 512 ' INFO : ---------------------------------------------------------- ' INFO : counted body parts: 19