--~ ./start.sh -sdg -res 640x480 --~ ./start.sh -grannytest cDebugGrannyMenu = CreateClass(cDebugMode) local testdata = { --female --~ {artid=401, content={}}, --~ {artid=401, content=({{artid=5899,animid=477},{artid=5422,animid=430},{artid=5399,animid=434},{artid=5435,animid=466},{artid=8251,animid=700},{artid=3701,animid=422},})}, -- male --~ {artid=400, content={}}, --~ {artid=400, content=({{artid=5905,animid=476},{artid=5422,animid=430},{artid=7933,animid=435},{artid=5909,animid=406},{artid=5441,animid=490},{artid=3701,animid=422},{artid=8251,animid=700},})}, --~ PrintBrokenGrannyInfo 257 DreadHorn gBrokenGrannyModelIdList --~ PrintBrokenGrannyInfo 774 Dawn_Girl gBrokenGrannyModelIdList --~ PrintBrokenGrannyInfo 276 Raptalon gGrannyFilter 60 nil --~ PrintBrokenGrannyInfo 311 shadow_knight gGrannyFilter 310 nil --~ PrintBrokenGrannyInfo 257 DreadHorn gGrannyFilter 200 nil --~ PrintBrokenGrannyInfo 1987 H_Female_Robe_GM_V2 gGrannyFilter 401 nil --~ PrintBrokenGrannyInfo 970 player_ghost gGrannyFilter 402 nil --~ PrintBrokenGrannyInfo 778 swarm gGrannyFilter 16 nil --~ PrintBrokenGrannyInfo 780 bog_thing gGrannyFilter 779 nil --~ PrintBrokenGrannyInfo 292 llamas_llama_pack gGrannyFilter 220 nil --~ PrintBrokenGrannyInfo 114 equines_horse_dark_steed gMountGrannyOverride 200 --~ PrintBrokenGrannyInfo 116 equines_horse_nightmare gMountGrannyOverride 200 --~ PrintBrokenGrannyInfo 178 equines_horse_nightmare gMountGrannyOverride 200 --~ PrintBrokenGrannyInfo 190 equines_horse_firesteed gMountGrannyOverride 200 --~ PrintBrokenGrannyInfo 791 giant_beetle gMountGrannyOverride 200 --~ PrintBrokenGrannyInfo 257 DreadHorn gMountGrannyOverride 200 --~ PrintBrokenGrannyInfo 794 swamp_dragon gMountGrannyOverride 200 --~ PrintBrokenGrannyInfo 226 equines_horse_dappled_grey gMountGrannyOverride 200 --~ PrintBrokenGrannyInfo 117 equines_horse_silver_steed gMountGrannyOverride 200 --~ PrintBrokenGrannyInfo 284 MondainSteed01 gMountGrannyOverride 200 --~ PrintBrokenGrannyInfo 291 equines_horse_dappled_brown_pack gMountGrannyOverride 118 --~ PrintBrokenGrannyInfo 799 swamp_dragon_armor gMountGrannyOverride 200 --~ PrintBrokenGrannyInfo 204 equines_horse_dark_brown gMountGrannyOverride 200 --~ PrintBrokenGrannyInfo 177 equines_horse_nightmare gMountGrannyOverride 200 --~ PrintBrokenGrannyInfo 228 equines_horse_tan gMountGrannyOverride 200 --~ PrintBrokenGrannyInfo 276 Raptalon gMountGrannyOverride 105 --~ PrintBrokenGrannyInfo 179 equines_horse_nightmare gMountGrannyOverride 200 --~ PrintBrokenGrannyInfo 115 equines_horse_ethereal gMountGrannyOverride 200 } function StartDebugGrannyMenu () cDebugGrannyMenu:StartMenu() end function cDebugGrannyMenu:StartMenu () gCurrentRenderer = Renderer3D Load_Granny() -- needs Renderer3D Load_Stitchin() --~ self:PrintBrokenGrannyInfos() --~ self:ClearGrannyOverrides() self:MakeGrid({0,0,0},{1,0,0},{0,1,0},5,5,true) local modelid = 791 -- giant_beetle local modelid = 200 -- standard horse --~ self:MakeOldGranny(modelid) self:MakeNewGranny(modelid) print("") self:StartMainLoop() end function cDebugGrannyMenu:MakeOldGranny (artid) local mobile = {artid=artid} local gfx = CreateRootGfx3D() local body = CreateBodyGfx(gfx) body:MarkForUpdate(mobile.artid,mobile.hue,mobile.content) body:Update() local bMoving,bTurning,bWarMode,bRunFlag = false,false,false,false --~ bMoving = true --~ if (gDebugMenuAnimIndex == -1) then bMoving = true,true,true end --~ if (gDebugMenuAnimIndex == -2) then bMoving,bRunFlag = true,true,true end --~ if (gDebugMenuAnimIndex == -3) then bWarMode,bMoving = true,true,true end --~ if (gDebugMenuAnimIndex == -4) then bWarMode,bMoving,bRunFlag = true,true,true end body:SetState(bMoving,bTurning,bWarMode,bRunFlag) gfx:SetPosition(0,2,0) --~ if (gDebugMenuAnimIndex >= 0) then body:StartAnimLoop(gDebugMenuAnimIndex) end --~ body:StartAnimLoop(1) -- notes : -- CreateBodyGfxPartsFromModelIDArray --~ local skeleton = GetOrCreateSkeleton(bodyid) -- skeleton is determined by the bodyid, not possible from the wearables --~ local skeleton_name = skeleton and skeleton.name or "unknown_skeleton" --~ local meshname = GetGrannyMeshName(modelid,skeleton_name,element.hue or 0) --~ local mygranny = GetGrannyModelLoader(modelid) --~ local matname = GetGrannyMat(modelid,hue,mygranny) --~ local modelinfo = GetGrannyModelInfo(modelid) --~ local modelpath = CorrectGrannyPath(gGrannyTypeDirs[modelinfo.typeid] .. modelinfo.modelname .. "_LOD2.grn") end function cDebugGrannyMenu:PrintBrokenGrannyInfo_One (modelid,...) local modelinfo = GetGrannyModelInfo(modelid,true) print("PrintBrokenGrannyInfo",modelid,modelinfo and sprintf("%35s",modelinfo.modelname),...) end function cDebugGrannyMenu:ClearGrannyOverrides () gBrokenGrannyModelIdList = {} gGrannyFilter = {} gMountGrannyOverride = {} end function cDebugGrannyMenu:PrintBrokenGrannyInfos () -- GetGrannyModelInfo : gBrokenGrannyModelIdList -> nil for modelid,v in pairs(gBrokenGrannyModelIdList) do self:PrintBrokenGrannyInfo_One(modelid,"gBrokenGrannyModelIdList") end -- GetGrannyMeshName : modelid = GrannyOverride(modelid) for modelid,filter in pairs(gGrannyFilter) do self:PrintBrokenGrannyInfo_One(modelid,"gGrannyFilter",filter.grannyid,filter.meshname) end --~ GrannyOverride(bodyid) : if (gGrannyFilter[bodyid]) then return gGrannyFilter[bodyid].grannyid --~ GrannyMeshOverride(bodyid) : if (gGrannyFilter[bodyid]) then return gGrannyFilter[bodyid].meshname --~ gMountTranslate[0x3EAA] = 0x73 --//=115, 0x20DD, Ethereal Horse 2D ?? equip-artid for mount-layer ? --~ gMountGrannyOverride[0x114] = 0x69 -- chimera : wing broken in 3d for modelid,newid in pairs(gMountGrannyOverride) do self:PrintBrokenGrannyInfo_One(modelid,"gMountGrannyOverride",newid) end -- todo : stitchin ? gStitchinLoader[oldelement.modelid] .. end gGrannyDebug_Anims_Horse = { "Equines_Horse_Dappled_Brown_Attack1.grn", "Equines_Horse_Dappled_Brown_Fidget.grn", "Equines_Horse_Dappled_Brown_Lod2.grn", "Equines_Horse_Dappled_Brown_Walk.grn", "Equines_Horse_Dappled_Brown_Die1.grn", "Equines_Horse_Dappled_Brown_Gethit.grn", "Equines_Horse_Dappled_Brown_Pack_Lod2.grn", "Equines_Horse_Dappled_Brown_Eat.grn", "Equines_Horse_Dappled_Brown_Idle.grn", "Equines_Horse_Dappled_Brown_Run.grn", } gGrannyDebug_Anims_Beetle = { "Giant_Beetle_Fire_LOD2.grn", "Giant_Beetle_Attack1.grn", "Giant_Beetle_Idle.grn", "Giant_Beetle_Fidget.grn", "Giant_Beetle_Fidget2.grn", "Giant_Beetle_Attack3.grn", "Giant_Beetle_ethereal_LOD2.grn", "Giant_Beetle_Lod2.grn", "Giant_Beetle_Walk.grn", "Giant_Beetle_Die1.grn", "Giant_Beetle_Attack2.grn", "Giant_Beetle_GetHit.grn", "Giant_Beetle_Run.grn", } function cDebugGrannyMenu:MakeNewGranny (artid) artid = 200 -- horse local folder = "/cavern/uoml_freshinstall.4.x/Models/Animals/" local matname = GetGrannyMat(artid,0,GetGrannyModelLoader(artid)) local filepath = GetGrannyFilePath(artid) local grn = cGrannyFile:New() grn:LoadFile(filepath) local pGrannyLoader = {} if (1 == 1) then -- wrap grn into pGrannyLoader local Object = grn.pMainChunk.Object local mSubMeshes = {} pGrannyLoader.mSubMeshes = mSubMeshes for kMeshIndex,mesh in ipairs(Object.mesh_list.childs or {}) do local pLoaderSubMesh = {} table.insert(mSubMeshes,pLoaderSubMesh) pLoaderSubMesh.mWeights = {} pLoaderSubMesh.mTexCoords = {} --~ local weightdata = {} --~ table.insert(pLoaderSubMesh.mWeights,weightdata) --~ weightdata.iNumBones = 0 --~ weightdata.pWeights = {} --~ local weight = {} --~ table.insert(weightdata.pWeights,weight) --~ weight.iWeightBoneIndex = 0 --~ weight.fWeight = 0 --~ if (mesh.weights and mesh.weights.list_weightchunks and #mesh.weights.list_weightchunks > 0) then bHasBoneWeights = true end --~ if (mesh.polygons and mesh.polygons.list_polygons and #mesh.polygons.list_polygons > 0) then bIsEmptyMesh = false end local polygons = mesh.polygons.list_polygons local point_container = mesh.point_block.point_container local positions = point_container.points.list_points local normals = point_container.normals.list_normals local texcoords = point_container.texture_container.texcoords and point_container.texture_container.texcoords.list_texcoords local texture_poly = Object.texture_list.texture.texture_sublist.childs[kMeshIndex] local texpolys = texture_poly.texture_poly_list.list_texpoly_normal -- sanity checks if (texpolys) then assert(#polygons == #texpolys) for k,texpoly in ipairs(texpolys) do assert(texpoly.iUnknown == k-1) end end pLoaderSubMesh.mPolygons = polygons pLoaderSubMesh.mTexturePolyLists = texpolys pLoaderSubMesh.mTexCoords = texcoords pLoaderSubMesh.mPoints = positions pLoaderSubMesh.mNormals = normals end end local szMatName = matname local szMeshName = "MyGrannyTest_Mesh_123" local szSkeletonName = "MyGrannyTest_Skel_123" local res = LoadGrannyAsOgreMesh(pGrannyLoader,szMatName,szMeshName,szSkeletonName) -- create instance local sceneManager = GetSceneManager() local sMeshName = szMeshName local sEntityName = GetUniqueName() local entity = sceneManager:createEntity(sEntityName,sMeshName) local gfx = CreateRootGfx3D() local scenenode = gfx:GetSceneNode() scenenode:attachObject(entity) end function cDebugGrannyMenu:MakeNewGranny_OldDump (artid) --~ artid = 791 -- beetle artid = 200 -- horse gDebugCategories.granny = true local folder = "/cavern/uoml_freshinstall.4.x/Models/Animals/" local matname = GetGrannyMat(artid,0,GetGrannyModelLoader(artid)) print("================= MakeNewGranny") local filepath = GetGrannyFilePath(artid) --~ filepath = folder.."Giant_Beetle_Walk.grn" --~ filepath = folder.."Equines_Horse_Dappled_Brown_Walk.grn" print("granny path for artid",artid,filepath) local grn = cGrannyFile:New() grn:LoadFile(filepath) if (1 == 2) then for k,filename in pairs(gGrannyDebug_Anims_Horse) do local grn2 = cGrannyFile:New() grn2:LoadFile(folder..filename) grn2:XMLDump("../mygranny/mygranny.horse."..filename..".xml") end local folder = "/cavern/uoml_freshinstall.4.x/Models/Animals/" for k,filename in pairs(gGrannyDebug_Anims_Beetle) do local grn2 = cGrannyFile:New() grn2:LoadFile(folder..filename) grn2:XMLDump("../mygranny/mygranny.beetle."..filename..".xml") end end function MyGetChunkT (iChunkType) return iChunkType and grn.kTypeNames[iChunkType] or nil end function MyDump (obj) print("dump:",obj,MyGetChunkT(obj and obj.iChunkType)) for k,v in pairs(obj) do print(" ",k,v,MyGetChunkT(v and type(v) == "table" and v.iChunkType)) end end function MyFilterFields (arr) if (type(arr) ~= "table") then return arr end local res = {} local blocked = {iChildren=true,childsleft=true,iChunkType=true,iOffset=true,} -- ,childs=table: 0x9532d20 for k,v in pairs(arr) do if (not blocked[k]) then res[k] = v end end return res end function MyGrannyDump(arr,name,subfield,levels) if (not arr) then print(name,"!!NIL!!") return end if (#arr == 0) then print(name,"!!EMPTY!!",SmartDump(MyFilterFields(arr))) end for k,entry in ipairs(arr) do if (k<=11) then print(name,k.."/"..#arr,SmartDump(MyFilterFields(subfield and entry[subfield] or entry),levels or 2)) end end end --~ function MyGrannyDump() end -- block output local Object = grn.pMainChunk.Object MyGrannyDump(Object.textChunk.texts,"text") --~ MyDump(Object.mesh_list.mesh) local mesh = Object.mesh_list.mesh local point_container = mesh and mesh.point_block.point_container if (point_container) then MyGrannyDump(point_container.points.list_points,"point") MyGrannyDump(point_container.normals.list_normals,"normal") if (point_container.texture_container.texcoords) then print("texcoords:unknown:", point_container.texture_container.texcoords.unknown) MyGrannyDump(point_container.texture_container.texcoords.list_texcoords,"texcoord") end end if (mesh) then print("weights:",SmartDump(MyFilterFields(mesh.weights))) MyGrannyDump(mesh.weights.list_weightchunks,"weight",nil,3) MyGrannyDump(mesh.polygons.list_polygons,"polygon") end MyGrannyDump(Object.boneTies1.childs,"boneTies1:boneobject",nil,3) MyGrannyDump(Object.bones.skeleton.bonelist.childs,"bone","bone") local btcont = Object.boneTies2.boneties_container local a = btcont.bone_objptrs_container.bone_objptr local b = btcont.bonetie_container and btcont.bonetie_container.bonetie_group and btcont.bonetie_container.bonetie_group.bonetie_list --[[ 0) then bHasBoneWeights = true end if (submesh.polygons and submesh.polygons.list_polygons and #submesh.polygons.list_polygons > 0) then bIsEmptyMesh = false end end if (bIsEmptyMesh) then return false end local pSkeleton if (bHasBoneWeights) then --~ local szSkeletonName = GetUniqueName() --~ CreateSkeleton : pSkeleton = SkeletonManager_create(szSkeletonName,Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,true); --~ local pSkeleton = SkeletonManager_load(szSkeletonName) --~ if (pSkeleton) then pMesh:setSkeletonName(pSkeleton:getName()) assert(szSkeletonName == pSkeleton:getName()) end -- getname != name i think, there was something weird here end local sMeshName = GetUniqueName() or "MyGrannyMeshName01" local pOgreMesh = MeshManager_createManual(sMeshName) pOgreMesh:_setBounds({0,0,0,0,0,0}, true) pOgreMesh:_setBoundingSphereRadius(0) --~ local mesh = Object.mesh_list.childs[1] -- .mesh*26 --~ local texture_poly = Object.texture_list.texture.texture_sublist.childs[1] -- .texture_poly -- *26 if (Object.mesh_list) then for k,submesh in ipairs(Object.mesh_list.childs or {}) do local texture_poly = Object.texture_list.texture.texture_sublist.childs[k] MyMakeGrannyGfx(submesh,texture_poly,pOgreMesh) end end pOgreMesh:load(false) local sceneManager = GetSceneManager() local sEntityName = GetUniqueName() local entity = sceneManager:createEntity(sEntityName,sMeshName) local gfx = CreateRootGfx3D() local scenenode = gfx:GetSceneNode() scenenode:attachObject(entity) --~ os.exit(0) end --[[ cGrannyFile:LoadFile /cavern/uoml_freshinstall.4.x/Models/Animals/Equines_Horse_Dappled_Brown_Walk.grn text 1/42 "__Standard" text 2/42 "__FileName" text 3/42 "R:\content\Game\Fauna\Creatures\Equines\Max\Anim\equines_horse_dappled_brown_walk.max" text 4/42 "__ObjectName" text 5/42 "Bip01 L Finger0" text 6/42 "__Description" text 7/42 "Bip01 L Hand" text 8/42 "Bip01 R Clavicle" text 9/42 "Bip01 Tail" text 10/42 "Bip01 R UpperArm" text 11/42 "Bip01 R Calf" boneTies1:boneobject 1/36 {childs={[1]={iID=3 },},} boneTies1:boneobject 2/36 {childs={[1]={iID=1 },},} boneTies1:boneobject 3/36 {childs={[1]={iID=2 },},} boneTies1:boneobject 4/36 {childs={[1]={iID=9=0x09 },},} boneTies1:boneobject 5/36 {childs={[1]={iID=21=0x15 },},} boneTies1:boneobject 6/36 {childs={[1]={iID=16=0x10 },},} boneTies1:boneobject 7/36 {childs={[1]={iID=6 },},} boneTies1:boneobject 8/36 {childs={[1]={iID=19=0x13 },},} boneTies1:boneobject 9/36 {childs={[1]={iID=8 },},} boneTies1:boneobject 10/36 {childs={[1]={iID=12=0x0c },},} boneTies1:boneobject 11/36 {childs={[1]={iID=13=0x0d },},} bone 1/36 {fTranslate={[1]=0,[2]=0,[0]=0,},iParent=0,fMatrix={[1]=0,[2]=0,[3]=0,[4]=1,[5]=0,[6]=0,[7]=0,[8]=1,[0]=1,},fQuaternion={[1]=0,[2]=0,[3]=1,[0]=0,},} bone 2/36 {fTranslate={[1]=-0.000461,[2]=0,[0]=0,},iParent=0,fMatrix={[1]=0,[2]=0,[3]=0,[4]=1,[5]=0,[6]=0,[7]=0,[8]=1,[0]=1,},fQuaternion={[1]=0,[2]=0,[3]=1,[0]=0,},} bone 3/36 {fTranslate={[1]=0.473461,[2]=1.085400,[0]=-0.008964,},iParent=1,fMatrix={[1]=0.000000,[2]=-0.000000,[3]=0.000000,[4]=1,[5]=0.000000,[6]=0.000000,[7]=0.000000,[8]=1,[0]=1,},fQuaternion={[1]=0.003099,[2]=-0.710178,[3]=0.704009,[0]=0.003072,},} bone 4/36 {fTranslate={[1]=-0.000033,[2]=-0.003174,[0]=-0.003688,},iParent=2,fMatrix={[1]=-0.000000,[2]=0.000000,[3]=-0.000000,[4]=1,[5]=-0.000000,[6]=-0.000000,[7]=-0.000000,[8]=1,[0]=1,},fQuaternion={[1]=0.517145,[2]=0.482246,[3]=-0.482246,[0]=0.517144,},} bone 5/36 {fTranslate={[1]=0.146758,[2]=-0.011366,[0]=0.162539,},iParent=3,fMatrix={[1]=-0.000000,[2]=-0.000000,[3]=0.000000,[4]=1.000000,[5]=-0.000000,[6]=-0.000000,[7]=-0.000000,[8]=1.000000,[0]=1,},fQuaternion={[1]=0.002761,[2]=0.789323,[3]=0.611798,[0]=0.051632,},} bone 6/36 {fTranslate={[1]=-0.000356,[2]=0.000014,[0]=0.383526,},iParent=4,fMatrix={[1]=0.000000,[2]=0.000000,[3]=0.000000,[4]=1,[5]=-0.000000,[6]=0.000000,[7]=0.000000,[8]=1,[0]=1,},fQuaternion={[1]=0.045910,[2]=-0.092244,[3]=0.994571,[0]=-0.014532,},} bone 7/36 {fTranslate={[1]=-0.000114,[2]=-0.000003,[0]=0.455237,},iParent=5,fMatrix={[1]=-0.000000,[2]=0.000000,[3]=-0.000000,[4]=1.000000,[5]=0.000000,[6]=-0.000000,[7]=0.000000,[8]=1.000000,[0]=1.000000,},fQuaternion={[1]=-0.024543,[2]=-0.170306,[3]=0.985055,[0]=0.007792,},} bone 8/36 {fTranslate={[1]=-0.000084,[2]=0.000000,[0]=0.152219,},iParent=6,fMatrix={[1]=0.000000,[2]=0.000000,[3]=0.000000,[4]=1,[5]=-0.000000,[6]=0.000000,[7]=-0.000000,[8]=1.000000,[0]=1.000000,},fQuaternion={[1]=0.001701,[2]=-0.513025,[3]=0.858372,[0]=0.000739,},} bone 9/36 {fTranslate={[1]=-0.000251,[2]=0.000001,[0]=0.223847,},iParent=7,fMatrix={[1]=-0.000000,[2]=0.000000,[3]=-0.000000,[4]=1,[5]=-0.000000,[6]=-0.000000,[7]=-0.000000,[8]=1.000000,[0]=1.000000,},fQuaternion={[1]=0.004809,[2]=0.141923,[3]=0.989864,[0]=-0.001989,},} bone 10/36 {fTranslate={[1]=0.000000,[2]=-0.000000,[0]=0.329182,},iParent=8,fMatrix={[1]=0.000000,[2]=0.000000,[3]=0.000000,[4]=1,[5]=-0.000000,[6]=0.000000,[7]=-0.000000,[8]=1.000000,[0]=1.000000,},fQuaternion={[1]=-0.015708,[2]=-0.107925,[3]=0.993487,[0]=-0.032989,},} bone 11/36 {fTranslate={[1]=0.007118,[2]=-0.078183,[0]=0.043131,},iParent=9=0x09,fMatrix={[1]=0.000000,[2]=-0.000000,[3]=-0.000000,[4]=1,[5]=-0.000000,[6]=-0.000000,[7]=-0.000000,[8]=1.000000,[0]=1,},fQuaternion={[1]=-0.004665,[2]=-0.190827,[3]=0.981608,[0]=-0.003001,},} iBoneTie2ID= 1 bone_objptrs.iNum= 36 bt2:bone_objptr 1/36 24=0x18 bt2:bone_objptr 2/36 23=0x17 bt2:bone_objptr 3/36 22=0x16 bt2:bone_objptr 4/36 27=0x1b bt2:bone_objptr 5/36 26=0x1a bt2:bone_objptr 6/36 25=0x19 bt2:bone_objptr 7/36 30=0x1e bt2:bone_objptr 8/36 29=0x1d bt2:bone_objptr 9/36 28=0x1c bt2:bone_objptr 10/36 33=0x21 bt2:bone_objptr 11/36 32=0x20 bt2:bonetie !!NIL!! iTextureID 1 obj 1/36 {[2]=3,[4]=5,[6]=0,} -- 3=4/42 "__ObjectName" 5=6/42 "__Description" obj 2/36 {[2]=3,[4]=7,[6]=0,} obj 3/36 {[2]=3,[4]=8,[6]=0,} obj 4/36 {[2]=3,[4]=9=0x09,[6]=0,} obj 5/36 {[2]=3,[4]=10=0x0a,[6]=0,} obj 6/36 {[2]=3,[4]=11=0x0b,[6]=0,} obj 7/36 {[2]=3,[4]=12=0x0c,[6]=0,} obj 8/36 {[2]=3,[4]=13=0x0d,[6]=0,} obj 9/36 {[2]=3,[4]=14=0x0e,[6]=0,} obj 10/36 {[2]=3,[4]=15=0x0f,[6]=0,} obj 11/36 {[2]=3,[4]=16=0x10,[6]=0,} *************** cGrannyFile:LoadFile /home/ghoul/Desktop/cavern/uoml/Models/Animals/Equines_Horse_Dappled_Brown_Lod2.grn text 1/46 "__Standard" text 2/46 "__FileName" text 3/46 "r:\content\game\fauna\creatures\equines\max\equines_horse_dappled_brown_lod2.max" text 4/46 "__ObjectName" text 5/46 "Equines_Horse_Dappled_Brown" text 6/46 "__Description" text 7/46 "Bip01 Spine1" text 8/46 "master_equines_horse_dappled_brown" text 9/46 "__Root" text 10/46 "Bip01 Pelvis" text 11/46 "Bip01" point 1/223 {y=0.547549,x=-0.281395,z=1.035676,} point 2/223 {y=0.341187,x=-0.279739,z=0.754919,} point 3/223 {y=-0.344653,x=-0.253881,z=1.039981,} point 4/223 {y=0.520265,x=-0.246531,z=1.201591,} point 5/223 {y=0.243041,x=-0.243713,z=1.043599,} point 6/223 {y=-0.604263,x=-0.233141,z=0.808763,} point 7/223 {y=-0.345181,x=-0.222155,z=0.888647,} point 8/223 {y=-0.638878,x=-0.220125,z=0.967547,} point 9/223 {y=0.309630,x=-0.214871,z=1.149054,} point 10/223 {y=-0.460259,x=-0.212234,z=0.739967,} point 11/223 {y=0.311111,x=-0.222721,z=0.150869,} weights: {unknown_b=2,wnum=223=0xdf,unknown_a=32=0x20,list_weightchunks=table: 0x952e858,} weight 1/223 {iNumBones=1,list_pairs={[1]={iWeightBoneIndex=0,fWeight=1,},},} weight 2/223 {iNumBones=1,list_pairs={[1]={iWeightBoneIndex=0,fWeight=1,},},} weight 3/223 {iNumBones=1,list_pairs={[1]={iWeightBoneIndex=1,fWeight=1,},},} weight 4/223 {iNumBones=1,list_pairs={[1]={iWeightBoneIndex=2,fWeight=1,},},} weight 5/223 {iNumBones=2,list_pairs={[1]={iWeightBoneIndex=0,fWeight=0.500000,},[2]={iWeightBoneIndex=2,fWeight=0.500000,},},} weight 6/223 {iNumBones=1,list_pairs={[1]={iWeightBoneIndex=3,fWeight=1,},},} weight 7/223 {iNumBones=2,list_pairs={[1]={iWeightBoneIndex=3,fWeight=0.500000,},[2]={iWeightBoneIndex=4,fWeight=0.500000,},},} weight 8/223 {iNumBones=1,list_pairs={[1]={iWeightBoneIndex=1,fWeight=1,},},} weight 9/223 {iNumBones=1,list_pairs={[1]={iWeightBoneIndex=2,fWeight=1,},},} weight 10/223 {iNumBones=2,list_pairs={[1]={iWeightBoneIndex=3,fWeight=0.500000,},[2]={iWeightBoneIndex=5,fWeight=0.500000,},},} weight 11/223 {iNumBones=1,list_pairs={[1]={iWeightBoneIndex=6,fWeight=1,},},} polygon 1/442 {iVertex={[1]=83=0x53,[2]=72=0x48,[0]=82=0x52,},iNormal={[1]=83=0x53,[2]=72=0x48,[0]=82=0x52,},} polygon 2/442 {iVertex={[1]=134=0x86,[2]=148=0x94,[0]=140=0x8c,},iNormal={[1]=134=0x86,[2]=148=0x94,[0]=140=0x8c,},} polygon 3/442 {iVertex={[1]=158=0x9e,[2]=139=0x8b,[0]=148=0x94,},iNormal={[1]=158=0x9e,[2]=139=0x8b,[0]=148=0x94,},} polygon 4/442 {iVertex={[1]=82=0x52,[2]=72=0x48,[0]=87=0x57,},iNormal={[1]=82=0x52,[2]=72=0x48,[0]=87=0x57,},} polygon 5/442 {iVertex={[1]=87=0x57,[2]=84=0x54,[0]=121=0x79,},iNormal={[1]=87=0x57,[2]=84=0x54,[0]=121=0x79,},} polygon 6/442 {iVertex={[1]=134=0x86,[2]=121=0x79,[0]=138=0x8a,},iNormal={[1]=134=0x86,[2]=121=0x79,[0]=138=0x8a,},} polygon 7/442 {iVertex={[1]=84=0x54,[2]=119=0x77,[0]=121=0x79,},iNormal={[1]=84=0x54,[2]=119=0x77,[0]=121=0x79,},} polygon 8/442 {iVertex={[1]=138=0x8a,[2]=159=0x9f,[0]=148=0x94,},iNormal={[1]=138=0x8a,[2]=159=0x9f,[0]=148=0x94,},} polygon 9/442 {iVertex={[1]=138=0x8a,[2]=119=0x77,[0]=144=0x90,},iNormal={[1]=138=0x8a,[2]=119=0x77,[0]=144=0x90,},} polygon 10/442 {iVertex={[1]=120=0x78,[2]=134=0x86,[0]=140=0x8c,},iNormal={[1]=120=0x78,[2]=134=0x86,[0]=140=0x8c,},} polygon 11/442 {iVertex={[1]=148=0x94,[2]=139=0x8b,[0]=140=0x8c,},iNormal={[1]=148=0x94,[2]=139=0x8b,[0]=140=0x8c,},} boneTies1:boneobject 1/37 {childs={[1]={iID=6, },},} boneTies1:boneobject 2/37 {childs={[1]={iID=2, },},} boneTies1:boneobject 3/37 {childs={[1]={iID=7, },},} boneTies1:boneobject 4/37 {childs={[1]={iID=4, },},} boneTies1:boneobject 5/37 {childs={[1]={iID=3, },},} boneTies1:boneobject 6/37 {childs={[1]={iID=8, },},} boneTies1:boneobject 7/37 {childs={[1]={iID=5, },},} boneTies1:boneobject 8/37 {childs={[1]={iID=15=0x0f, },},} boneTies1:boneobject 9/37 {childs={[1]={iID=9=0x09, },},} boneTies1:boneobject 10/37 {childs={[1]={iID=10=0x0a, },},} boneTies1:boneobject 11/37 {childs={[1]={iID=11=0x0b, },},} bone 1/37 {fTranslate={[1]=0,[2]=0,[0]=0,},iParent=0,fMatrix={[1]=0,[2]=0,[3]=0,[4]=1,[5]=0,[6]=0,[7]=0,[8]=1,[0]=1,},fQuaternion={[1]=0,[2]=0,[3]=1,[0]=0,},} bone 2/37 {fTranslate={[1]=-0.000461,[2]=0,[0]=0,},iParent=0,fMatrix={[1]=0,[2]=0,[3]=0,[4]=1,[5]=0,[6]=0,[7]=0,[8]=1,[0]=1,},fQuaternion={[1]=0,[2]=0,[3]=1,[0]=0,},} bone 3/37 {fTranslate={[1]=0.473461,[2]=1.060614,[0]=-0.000000,},iParent=1,fMatrix={[1]=0.000000,[2]=0.000000,[3]=0.000000,[4]=1,[5]=0.000000,[6]=-0.000000,[7]=0.000000,[8]=1,[0]=1.000000,},fQuaternion={[1]=0.003085,[2]=-0.707100,[3]=0.707101,[0]=0.003085,},} bone 4/37 {fTranslate={[1]=-0.000001,[2]=-0.003174,[0]=-0.003688,},iParent=2,fMatrix={[1]=-0.000000,[2]=0.000000,[3]=-0.000000,[4]=1,[5]=0.000000,[6]=0.000000,[7]=-0.000000,[8]=1,[0]=1,},fQuaternion={[1]=-0.500000,[2]=-0.500000,[3]=0.500001,[0]=-0.499999,},} bone 5/37 {fTranslate={[1]=0.146738,[2]=-0.000000,[0]=0.162940,},iParent=3,fMatrix={[1]=-0.000000,[2]=0.000000,[3]=0.000000,[4]=1.000000,[5]=0.000000,[6]=0.000000,[7]=0.000000,[8]=1,[0]=1.000000,},fQuaternion={[1]=0.000102,[2]=0.769173,[3]=0.639041,[0]=-0.000088,},} bone 6/37 {fTranslate={[1]=0.187062,[2]=-0.188280,[0]=-0.114344,},iParent=4,fMatrix={[1]=0.000000,[2]=-0.000000,[3]=0.000000,[4]=1,[5]=0.000000,[6]=-0.000000,[7]=-0.000000,[8]=1,[0]=1,},fQuaternion={[1]=0.355465,[2]=-0.038615,[3]=-0.060378,[0]=0.931938,},} bone 7/37 {fTranslate={[1]=-0.000359,[2]=-0.000000,[0]=0.383541,},iParent=4,fMatrix={[1]=0.000000,[2]=0.000000,[3]=-0.000000,[4]=1,[5]=0.000000,[6]=0.000000,[7]=0.000000,[8]=1,[0]=1,},fQuaternion={[1]=0.000000,[2]=-0.069757,[3]=0.997564,[0]=-0.000000,},} bone 8/37 {fTranslate={[1]=-0.000077,[2]=0.000000,[0]=0.455183,},iParent=6,fMatrix={[1]=-0.000000,[2]=0.000000,[3]=0.000000,[4]=1,[5]=0.000000,[6]=0.000000,[7]=0.000000,[8]=1,[0]=1,},fQuaternion={[1]=-0.000001,[2]=-0.428783,[3]=0.903408,[0]=-0.000004,},} bone 9/37 {fTranslate={[1]=-0.142090,[2]=-0.112536,[0]=-0.024633,},iParent=7,fMatrix={[1]=0.000000,[2]=0.000000,[3]=0.000000,[4]=1.000000,[5]=0.000000,[6]=0.000000,[7]=0.000000,[8]=1.000000,[0]=1.000000,},fQuaternion={[1]=0.536666,[2]=-0.535021,[3]=-0.426220,[0]=0.494044,},} bone 10/37 {fTranslate={[1]=-0.000000,[2]=0.000000,[0]=0.352391,},iParent=8,fMatrix={[1]=0.000000,[2]=-0.000000,[3]=0.000000,[4]=1,[5]=-0.000000,[6]=0.000000,[7]=-0.000000,[8]=1.000000,[0]=1.000000,},fQuaternion={[1]=-0.525638,[2]=0.472182,[3]=0.501046,[0]=0.499702,},} bone 11/37 {fTranslate={[1]=-0.000000,[2]=0.000000,[0]=0.261671,},iParent=9=0x09,fMatrix={[1]=0.000000,[2]=0.000000,[3]=-0.000000,[4]=1.000000,[5]=0.000000,[6]=0.000000,[7]=0.000000,[8]=1,[0]=1,},fQuaternion={[1]=-0.000000,[2]=-0.498851,[3]=0.866688,[0]=0.000000,},} iBoneTie2ID= 1 bone_objptrs.iNum= 37 bt2:bone_objptr 1/37 4 bt2:bone_objptr 2/37 5 bt2:bone_objptr 3/37 1 bt2:bone_objptr 4/37 7 bt2:bone_objptr 5/37 12=0x0c bt2:bone_objptr 6/37 34=0x22 bt2:bone_objptr 7/37 2 bt2:bone_objptr 8/37 3 bt2:bone_objptr 9/37 22=0x16 bt2:bone_objptr 10/37 20=0x14 bt2:bone_objptr 11/37 21=0x15 bt2:bonetie 1/33 {iBone=5,iUnknown={[1]=-0.058629,[2]=-0.237984,[3]=-0.162302,[4]=0.358194,[5]=0.183488,[6]=0.102694,[0]=0.367406,},} bt2:bonetie 2/33 {iBone=8,iUnknown={[1]=-0.040035,[2]=0.008894,[3]=-0.147809,[4]=0.371476,[5]=0.125108,[6]=0.136732,[0]=0.386154,},} bt2:bonetie 3/33 {iBone=4,iUnknown={[1]=-0.261872,[2]=-0.080894,[3]=-0.246581,[4]=0.385943,[5]=0.416525,[6]=0.246485,[0]=0.500515,},} bt2:bonetie 4/33 {iBone=9=0x09,iUnknown={[1]=-0.053002,[2]=-0.150285,[3]=-0.092842,[4]=0.289619,[5]=0.132025,[6]=0.142190,[0]=0.291440,},} bt2:bonetie 5/33 {iBone=6,iUnknown={[1]=-0.022146,[2]=-0.100626,[3]=-0.221972,[4]=0.312453,[5]=0.468180,[6]=0.222517,[0]=0.555906,},} bt2:bonetie 6/33 {iBone=10=0x0a,iUnknown={[1]=-0.013907,[2]=-0.233039,[3]=-0.070689,[4]=0.381548,[5]=0.056935,[6]=0.074321,[0]=0.383907,},} bt2:bonetie 7/33 {iBone=12=0x0c,iUnknown={[1]=-0.027222,[2]=-0.101896,[3]=-0.065225,[4]=0.337428,[5]=0.090531,[6]=0.068422,[0]=0.346670,},} bt2:bonetie 8/33 {iBone=14=0x0e,iUnknown={[1]=-0.090859,[2]=-0.000313,[3]=-0.060973,[4]=-0.007980,[5]=-0.000094,[6]=0.062011,[0]=0.091001,},} bt2:bonetie 9/33 {iBone=11=0x0b,iUnknown={[1]=0.023739,[2]=-0.177858,[3]=-0.053214,[4]=0.344609,[5]=0.098641,[6]=0.038090,[0]=0.344661,},} bt2:bonetie 10/33 {iBone=13=0x0d,iUnknown={[1]=-0.009283,[2]=-0.102775,[3]=-0.044248,[4]=0.176347,[5]=0.125947,[6]=0.049843,[0]=0.216987,},} bt2:bonetie 11/33 {iBone=15=0x0f,iUnknown={[1]=-0.033795,[2]=-0.111544,[3]=-0.066103,[4]=0.275743,[5]=0.054734,[6]=0.055887,[0]=0.285613,},} iTextureID 1 iElementSize 16 iNum 442 list_texpoly_normal 1/442 {iUnknown=0,iTexCoord={[1]=45=0x2d,[2]=43=0x2b,[0]=29=0x1d,},} list_texpoly_normal 2/442 {iUnknown=1,iTexCoord={[1]=31=0x1f,[2]=43=0x2b,[0]=29=0x1d,},} list_texpoly_normal 3/442 {iUnknown=2,iTexCoord={[1]=57=0x39,[2]=45=0x2d,[0]=43=0x2b,},} list_texpoly_normal 4/442 {iUnknown=3,iTexCoord={[1]=29=0x1d,[2]=43=0x2b,[0]=31=0x1f,},} list_texpoly_normal 5/442 {iUnknown=4,iTexCoord={[1]=31=0x1f,[2]=42=0x2a,[0]=33=0x21,},} list_texpoly_normal 6/442 {iUnknown=5,iTexCoord={[1]=31=0x1f,[2]=33=0x21,[0]=42=0x2a,},} list_texpoly_normal 7/442 {iUnknown=6,iTexCoord={[1]=48=0x30,[2]=69=0x45,[0]=34=0x22,},} list_texpoly_normal 8/442 {iUnknown=7,iTexCoord={[1]=48=0x30,[2]=53=0x35,[0]=43=0x2b,},} list_texpoly_normal 9/442 {iUnknown=8,iTexCoord={[1]=48=0x30,[2]=69=0x45,[0]=75=0x4b,},} list_texpoly_normal 10/442 {iUnknown=9=0x09,iTexCoord={[1]=17=0x11,[2]=31=0x1f,[0]=29=0x1d,},} list_texpoly_normal 11/442 {iUnknown=10=0x0a,iTexCoord={[1]=43=0x2b,[2]=45=0x2d,[0]=29=0x1d,},} obj 1/40 {[2]=3,[4]=5,[6]=0,} obj 2/40 {[2]=3,[4]=7,[6]=0,} obj 3/40 {[2]=3,[4]=8,[6]=0,} obj 4/40 { [4]=9=0x09,} obj 5/40 {[2]=3,[4]=10=0x0a,[6]=0,} obj 6/40 {[2]=3,[4]=11=0x0b,[6]=0,} obj 7/40 {[2]=3,[4]=12=0x0c,[6]=0,} obj 8/40 {[2]=3,[4]=5,[6]=0,} obj 9/40 {[2]=3,[4]=13=0x0d,[6]=0,} obj 10/40 {[2]=3,[4]=14=0x0e,[6]=0,} obj 11/40 {[2]=3,[4]=15=0x0f,[6]=0,} point 1/557 {y=-0.710749,x=-0.767177,z=1.416132,} normal 1/553 {y=0,x=0,z=0,} texcoord 1/2286 {y=0.082323,x=0.089491,z=0.418126,} 2286/6/3 = 127 polygon 1/1102 {iVertex1=3,iNormal2=4,iVertex2=4,iNormal3=140=0x8c,iNormal1=3,iVertex3=140=0x8c,} polygon 1/1102 {iVertex={[1]=4,[2]=140=0x8c,[0]=3,},iNormal={[1]=4,[2]=140=0x8c,[0]=3,},} list_texpoly_normal 1/1102 {iUnknown=0,iTexCoord={[1]=724=0x02d4,[2]=736=0x02e0,[0]=723=0x02d3,},} -- animation : -- GetOrCreateSkeleton : load all bodyparts, load all anims, add to skeleton : (single CreateSkeleton(skeletonname)) mygrannyanim:AddAnimToSkeleton(skeleton.name,animname,bodypartsamples) -- grannyogreloader.cpp : int iCurBoneNum = mpGrannyLoader->FindBone(mpGrannyLoader->GetBoneName2(pAnim.mpAnim->iID-1)); -- beetle : walk hat eigenes mesh ?!? (MEHRERE SUBMESHES!) /cavern/uoml_freshinstall.4.x/Models/Animals/Giant_Beetle_Walk.grn ne, nur so hilfobjekte krams oder sowas... -- bones -- comparison beetle vs horse beetle...meshlist.mesh : horse...meshlist.mesh : one anim per file! horse : text 1/46 "__Standard" point 1/223 {y=0.547549,x=-0.281395,z=1.035676,} normal 1/223 {y=0.281497,x=-0.956108,z=-0.081349,} texcoord 1/222 {y=0.689825,x=-0.101103,z=1,} list_texpoly_normal 1/442 {iUnknown=0,iTexCoord={[1]=45=0x2d,[2]=43=0x2b,[0]=29=0x1d,},} polygon 1/442 {iVertex={[1]=83=0x53,[2]=72=0x48,[0]=82=0x52,},iNormal={[1]=83=0x53,[2]=72=0x48,[0]=82=0x52,},} weights: {unknown_b=2,wnum=223=0xdf,unknown_a=32=0x20,list_weights=table: 0xa6208c8,} weight 1/223 {iNumBones=1,list_pairs={[1]={iWeightBoneIndex=0,fWeight=1,},},} boneTies1:boneobject 1/37 {childs={[1]=table: 0xa762850,},} bone 1/37 {fTranslate={[1]=0,[2]=0,[0]=0,},iParent=0,fMatrix={[1]=0,[2]=0,[3]=0,[4]=1,[5]=0,[6]=0,[7]=0,[8]=1,[0]=1,},fQuaternion={[1]=0,[2]=0,[3]=1,[0]=0,},} bt2:bone_objptr 1/37 4 bt2:bonetie 1/33 {iBone=5,iUnknown={[1]=-0.058629,[2]=-0.237984,[3]=-0.162302,[4]=0.358194,[5]=0.183488,[6]=0.102694,[0]=0.367406,},} obj 1/40 {[2]=3,[4]=5,[6]=0,} weights : case 0XCA5E0702: VisitWeights(pInts[0],pInts[1],pInts[2],pData+3*4,iSize-3*4); ... mpLastSubMesh->mWeights = std::make_pair(pData,iNum); // prepare bone-weight data if (bUseSkeleton) { sub->clearBoneAssignments(); myBoneWeights.reserve(pLoaderSubMesh.mWeights.second); // WARNING ! buffersize not checked, but as long as the granny files are intakt thats ok // foreach point : bonenum, index,weight, index,weight,... const ::uint32* p = (::uint32*)pLoaderSubMesh.mWeights.first; ---------- pData for (int i=0;ireserve(iNumBones); for (int k=0;kpush_back(std::make_pair(iWeightBoneIndex,fWeight)); } } } unknown : point 1/223 {y=0.547549,x=-0.281395,z=1.035676,} texcoord 1/222 {y=0.689825,x=-0.101103,z=1,} polygon 1/442 {iVertex={[1]=83=0x53,[2]=72=0x48,[0]=82=0x52,},iNormal={[1]=83=0x53,[2]=72=0x48,[0]=82=0x52,},} list_texpoly_normal 1/442 {iUnknown=0,iTexCoord={[1]=45=0x2d,[2]=43=0x2b,[0]=29=0x1d,},} weights: {unknown_b=2,wnum=223=0xdf,unknown_a=32=0x20,list_weights=table: 0xaf93098,} weight 1/809 {w=0.000000,} boneTies1:boneobject 1/37 {childs={[1]=table: 0xa538fd0,},} bone 1/37 {fTranslate={[1]=0,[2]=0,[0]=0,},iParent=0,fMatrix={[1]=0,[2]=0,[3]=0,[4]=1,[5]=0,[6]=0,[7]=0,[8]=1,[0]=1,},fQuaternion={[1]=0,[2]=0,[3]=1,[0]=0,},} iBoneTie2ID= 1 bone_objptrs.iNum= 37 bt2:bone_objptr 1/37 4 bt2:bonetie 1/33 {iBone=5,iUnknown={[1]=-0.058629,[2]=-0.237984,[3]=-0.162302,[4]=0.358194,[5]=0.183488,[6]=0.102694,[0]=0.367406,},} obj 1/40 {[2]=3,[4]=5,[6]=0,} Ogre::Quaternion GetBoneRotate (const GrannyBone* pGrannyBone) { return Ogre::Quaternion(pGrannyBone ? pGrannyBone->fQuaternion[3]:1, // ogre:w,x,y,z granny:x,y,z,w pGrannyBone ? pGrannyBone->fQuaternion[0]:0, pGrannyBone ? pGrannyBone->fQuaternion[1]:0, pGrannyBone ? pGrannyBone->fQuaternion[2]:0); } ]]-- function GrannyTest_PreOgreInit2 () if (not gUOPath) then AutoDetectUOPath() end CheckUODir() cDebugGrannyMenu:MakeNewGranny(791) os.exit() end -- ***** ***** ***** end