Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding some weight if the vertex has none #40

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

set-killer
Copy link
Contributor

Fixing a warning if the vertexes has 0 weight. Issue #38

@ghost
Copy link

ghost commented Oct 23, 2016

Your fix is good (and it was in the TODO), but can a smaller (closer to 0) number than 0.001 be used?

@set-killer
Copy link
Contributor Author

I guess it should be possible. How much smaller?

<color> 0.800000011920929 0.800000011920929 0.800000011920929 1.0 </color>
This is how the color 0.8 0.8 0.8 is written into the exported files. So 7 digits after the delimiter looks fine.

Will fix it and make some tests soon.

@ghost
Copy link

ghost commented Oct 24, 2016

@set-killer The smallest possible - it means zero after all. I think you could even go 0.000000000000001.

Edit: How come it's not possible for vertexes to have zero weight?

@set-killer
Copy link
Contributor Author

That is what i found in the documentation (page 174):

Generating default blending weights, usually with some fall-off function: 
the farther a joint is from a given vertex, the less it influences it. 
Also, if a weight is 0, the influence can be omitted. 

That should mean vertexes with weight 0 may not be influenced by the bone. In that case i am not sure that we should artificially add weight to the vertexes.

@ghost
Copy link

ghost commented Oct 25, 2016

In that case we should reconsider what #38 says. Is the "unassigned weights" error due to weights not being assigned at all or due to weights being zero (pinging @linuxfree2016)? If it's the former, I think that setting the weights to 0 is the right thing to do, according to what the documentation says.

v.bones.append(si["bone_index"][name])
v.weights.append(vg.weight)
wsum += vg.weight
# Using 0.001 since Blender uses zero weight
Copy link

@ghost ghost Oct 25, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is using zero weight here a problem and something greater than zero needs to be used? Is it a problem for Godot or for COLLADA? Pinging @reduz

@akien-mga
Copy link
Member

What's the status on this PR? Should I merge as is or do you want to experiment further with zero-er weights?

@Calinou Calinou added the bug label Feb 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants