this is how i received the data:
Code: Select all
header = player.model_header
bone = header.get_bone(x)
Code: Select all
header = player.model_header
bone = header.get_bone(x)
Code: Select all
print(model_cache.find_model("player/custom_player/legacy/ctm_idf_variante.mdl"))
print(model_cache.find_model("models/player/custom_player/legacy/tm_leet_variantC.mdl"))
print(model_cache.find_model("player/custom_player/legacy/tm_leet_variantC.mdl"))
681
1125
680
print(model_cache.get_model_header(model_cache.find_model("models/player/custom_player/legacy/ctm_idf_variantE.mdl")))
print(model_cache.get_model_header(model_cache.find_model("player/custom_player/legacy/ctm_idf_variante.mdl")))
print(model_cache.get_model_header(model_cache.find_model("models/player/custom_player/legacy/tm_leet_variantC.mdl")))
<_studio.ModelHeader object at 0x48269A98>
<_studio.ModelHeader object at 0x48269A98>
<_studio.ModelHeader object at 0x48269A98>
Code: Select all
print(model_cache.get_model_header(model_cache.find_model("models/player/custom_player/legacy/ctm_idf_variantE.mdl")).id)
print(model_cache.get_model_header(model_cache.find_model("models/player/custom_player/legacy/tm_leet_variantC.mdl")).id)
print(model_cache.get_model_header(model_cache.find_model("models/player/custom_player/legacy/ctm_idf_variantE.mdl")).name)
print(model_cache.get_model_header(model_cache.find_model("models/player/custom_player/legacy/tm_leet_variantC.mdl")).name)
1414743113
1414743113
player/custom_player/legacy/ctm_idf_variante.mdl
player/custom_player/legacy/tm_leet_variantC.mdl
Speed0x wrote:hey i've checked the bone structure for playermodels, but when i receive the bones it gives me the same values on position and euler values for all models ? ( as if this function only reads the data for one specific type of model ? )
Why do you expect them to be different?
Speed0x wrote:Why do you expect them to be different?
that's what i was wondering... when i calculated them ingame they were only aligning for some models... when i check in studiomdl the idle animation of both models ( modelviewer csgo:sdk ) bones LOOK different. but perhaps that derives from the animation.
bones.jpg
i am trying to calculate the current boneposition of a player. but i don't want to go through reading the animation sequence data, keep track of it and then recalculate the current bone position for each tick from that....
isn't there some function exposed for this from within the game ? ( getting current bone positions )
I think the default bone positions are not their idling stance, but their T pose they get when they hold no weapons
Speed0x wrote:I think the default bone positions are not their idling stance, but their T pose they get when they hold no weapons
with "idle" i meant "default" in the sequence tab of SDK.
i think the problem is that in my code i am just reading default mdl file bone positions... not "in world" bones positions...
but with the link : i am not looking to get the weapon muzzle flash position. i know how to workaround that... i was wondering if the engine had a way to access all active current bones positions. i think "CBaseAnimating::GetBoneTransform" looks like the right approach. as you suggested taking into account animations... did that code work?
Syntax: Select all
header = player.model_header
for index in range(header.bones_count):
if header.get_bone(index).name == 'ValveBiped.Bip01_R_Hand':
break
else:
return
GetBoneTransform = player.make_virtual_function(
199, Convention.THISCALL, [DataType.POINTER, DataType.INT, DataType.POINTER],
DataType.VOID)
matrix = Matrix3x4()
GetBoneTransform(player, index, matrix)
matrix.position # current position of the player's hand bone
Speed0x wrote:so the VFunction "GetBoneTransform" takes care of calculating the correct inworld-position by taking into account animations etc ? ( i am asking for comprehension as it would be done behind the scenes )
Speed0x wrote:okay, great. is the v_index you used for css or csgo ? sorry : i didn't mention that i am testing this in csgo.. :(
Users browsing this forum: No registered users and 35 guests