• BoneMatrix editing on a ClientSideModel
    4 replies, posted
So uh, i got myself into a mess that involved me not using normal Vmodels, and instead recreating the thing entirely using ClientSideModel. So far, i've got it to work perfectly. Except for the fact that BoneMatrix editing is a bitch, and i cant just C&P + edit code from the Swep Creation Kit to work with ClientSideModels whatsoever. Here's my code: [lua] SWEP.ViewModelBoneMods = { ["v_me_fireaxe"] = { scale = Vector(0.1, 0.1, 0.1), pos = Vector(0, 0, 0), angle = Angle(0, 0, 0) } } if CLIENT then self.VModel = ClientsideModel(self.ViewModel, RENDERGROUP_OPAQUE) self.VModel:SetNoDraw(true) self.VModel.LastEyeAng = EyeAngles() self.VModel:SetParent(self.Owner:GetViewModel()) end --SWEP initialize func if CLIENT then self.BuildViewModelBones = function( s ) if LocalPlayer():GetActiveWeapon() == self and self.ViewModelBoneMods then for k, v in pairs( self.ViewModelBoneMods ) do print(v) local vm = s.VModel local bone = vm:LookupBone(k) if (!bone) then continue end local m = vm:GetBoneMatrix(bone) if (!m) then continue end m:Scale(v.scale) m:Rotate(v.angle) m:Translate(v.pos) vm:SetBoneMatrix(bone, m) end end end then [/lua] Hopefully that's enough to give you an idea on what's going on. Any help would be appreciated.
Just use these without making a BuildBonePositions function: [CODE]vm:ManipulateBoneScale( bone, scale ) vm:ManipulateBoneAngles( bone, angle ) vm:ManipulateBonePosition( bone, pos )[/CODE]
too bad the bone is a number value. Any ideas on how i can return the index of that bone?
entity:LookupBone("bonename")
Still no change. Engine seems to ignore it.
Sorry, you need to Log In to post a reply to this thread.