x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

AnswerHub Maintenance

Background maintenance is scheduled to occur between 9 - 11am EDT on Tuesday, May 21. Site operation may be slower than normal during this time and a brief interruption in operation may be observed

How to get BoneWeights and BoneIndices of skeletalMesh c++?

Hello, I want to know the boneWeights and boneIndices for each vertex of a skeletalMesh Thanks.

Product Version: UE 4.16
Tags:
more ▼

asked Feb 15 '18 at 02:01 PM in C++ Programming

avatar image

OsamaTHS
1 1 5

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

I found the answer myself.

Here is how:

  • First you need to get the target mesh.

  • Then get the vertices.

  • After that we need to loop them, and use the index of the iteration to get the boneIndices and boneWeights of each vertex.

  • Now we have a uint8 value, we need to access the data inside this byte buffer.

  • We will cast this vertex.InfluenceBones[0] to Int, where index 0 for the first bone index and 1 for the second and so on for 3 and 4.

  • Now for boneWeights, almost the same for the previous step.

  • Firstly, we will cast vertex.InfluencesWeights[0] to Int then cast it to double and divide it with 255.0 where index 0 for the first bone index and 1 for the second and so on for 3 and 4.

    "255.0" is the maximum number of each byte in that buffer

alt text

untitledasd.png (24.9 kB)
more ▼

answered Mar 26 '18 at 11:48 AM

avatar image

OsamaTHS
1 1 5

avatar image zhuyuhang Apr 29 '19 at 11:19 AM

I used this method, but I got error bone index. The same FBX, many vertices bone index is 0(rootBone), but in Unity, no any vertices bone index is 0(rootBone)

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question