animate1978 / MB-Lab

MB-Lab is a character creation tool for Blender 4.0 and above, based off ManuelBastioniLAB
Other
1.85k stars 314 forks source link

Hair created with the 'Assets and Hair' tool cannot be simulated. #286

Closed Tylertron1998 closed 4 years ago

Tylertron1998 commented 4 years ago

For some reason, hair created with the 'Assets and Hair' tool cannot be simulated - no matter what. Is this intentional? What is causing this, and how would one go about fixing it?

Noizirom commented 4 years ago

Are you referring to particle hair? What do you mean by, cannot be stimulated.

On Tue, Jul 14, 2020, 1:54 AM Tyler Davis notifications@github.com wrote:

For some reason, hair created with the 'Assets and Hair' tool cannot be simulated - no matter what. Is this intentional? What is causing this, and how would one go about fixing it?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/animate1978/MB-Lab/issues/286, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKYHC3V35C4OUCUSR7ROWZDR3PXHPANCNFSM4OZFLLSA .

Tylertron1998 commented 4 years ago

Yes, the particle hair that is generated here: image

It cannot be simulated via the 'hair dynamics' tool in blender.

Noizirom commented 4 years ago

You may need to temporarily turn on the visibility to the emitter mesh in the object's panel.

On Tue, Jul 14, 2020, 4:03 AM Tyler Davis notifications@github.com wrote:

Yes, the particle hair that is generated here: [image: image] https://user-images.githubusercontent.com/34944514/87400494-cb109900-c5b0-11ea-833f-8f0cc1f86ba9.png

It cannot be simulated via the 'hair dynamics' tool in blender.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/animate1978/MB-Lab/issues/286#issuecomment-658034573, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKYHC3RTZH4XHKIVL6WPVUDR3QGNJANCNFSM4OZFLLSA .

animate1978 commented 4 years ago

From my own testing Hair Dynamics works just fine.

I created a short video showing the process to do this.

https://vimeo.com/438248118

Let me know if this process is not working for you?

animate1978 commented 4 years ago

As a side note... what version of MB-Lab are you using? I can't tell from the screenshot but it looks like 1.7.6? I would recommend upgrading to 1.7.7 if you haven't already. If you are using 1.7.7 again let us know if the process is not working

Tylertron1998 commented 4 years ago

@animate1978 I'm on 1.7.7 image

and these are definitely the steps I'm following. I'll see if I can get a video!

Tylertron1998 commented 4 years ago

I managed to get a recording; here: https://vimeo.com/438308353

As you see, I even created a brand new project, followed all of your steps. Things I have also tried:

none of these seem to work; but I don't think it's a problem with blender, as I can create, in the same scene, any primitive, add hair, and it works fine.

Tylertron1998 commented 4 years ago

I'll give the beta a go and report back.

Tylertron1998 commented 4 years ago

The beta doesn't seem to work for me; I'm getting this when attempting to finalize.

Traceback (most recent call last):
  File "C:\Users\sirbr\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\MB-Lab\__init__.py", line 1717, in execute
    mblab_humanoid.set_rest_pose()
  File "C:\Users\sirbr\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\MB-Lab\humanoid.py", line 1194, in set_rest_pose

  File "C:\Users\sirbr\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\MB-Lab\skeletonengine.py", line 119, in apply_armature_modifier
    algorithms.apply_modifier(obj, armature_modifier)
  File "C:\Users\sirbr\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\MB-Lab\algorithms.py", line 1142, in apply_modifier
    enum_property = ('NONE', 'CHOOSE', 'Choose one')
  File "C:\Program Files\Blender Foundation\Blender 2.83\2.83\scripts\modules\bpy\ops.py", line 201, in __call__
    ret = op_call(self.idname_py(), None, kw)
RuntimeError: Error: Modifier cannot be applied to a mesh with shape keys

location: <unknown location>:-1
animate1978 commented 4 years ago

I see. This is very strange. Not only with the fact that Hair Dynamics don't work but your getting that kind of error. I will look into this.

animate1978 commented 4 years ago

I am going to see if these problems are related to Blender 2.83.2.

I have been using 2.82 and just tried with 2.83.1

I am using Linux as opposed to yourself, using Windows.

I have also been looking in the Blender Developer bug reports and seeing if there are issues with Hair Dynamics

animate1978 commented 4 years ago

So just to update, I have not had issues with this particular version of Blender either. Not in the Hair Dynamics nor the Modifier bug you are getting.

Not to say your issue is not valid, it may be a problem with the Windows build combined with MB-Lab... I am just not getting these issues on my end but I will consult outside help somehow.

TetoTheSquirrelFox commented 4 years ago

The trackback does not make sense.

All error messages I had while developing tools for the addon had always lines that are related to the line above. I don't understand what's going on here.

Tylertron1998 commented 4 years ago

@animate1978 I'll give it ago on a completely different windows computer; and let you know if anything else changes! Also more than happy to provide any logs; something I did, however, forget to point out was this:

If I forgoe the hair 'tool' with mb lab completely; and instead; add a particle system to the humanoid mesh directly; I do get hair physics when using dynamics. This however, is not great as it has its own issues; such as the hair not colliding properly.

Tylertron1998 commented 4 years ago

@TetoTheSquirrelFox strange; I've just spun up blender again, I haven't changed anything; still using the development version of mblab and the same version of blender; but it works now

Noizirom commented 4 years ago

Have you tried removing the particle system and replacing it. At least that way it would be easier to pinpoint the problem from a MB lab side or from a blender side.

On Tue, Jul 14, 2020, 1:54 AM Tyler Davis notifications@github.com wrote:

For some reason, hair created with the 'Assets and Hair' tool cannot be simulated - no matter what. Is this intentional? What is causing this, and how would one go about fixing it?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/animate1978/MB-Lab/issues/286, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKYHC3V35C4OUCUSR7ROWZDR3PXHPANCNFSM4OZFLLSA .

Noizirom commented 4 years ago

Ignore. I just saw your comment.

On Wed, Jul 15, 2020, 8:32 AM Zion Hill Hill noizirom@gmail.com wrote:

Have you tried removing the particle system and replacing it. At least that way it would be easier to pinpoint the problem from a MB lab side or from a blender side.

On Tue, Jul 14, 2020, 1:54 AM Tyler Davis notifications@github.com wrote:

For some reason, hair created with the 'Assets and Hair' tool cannot be simulated - no matter what. Is this intentional? What is causing this, and how would one go about fixing it?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/animate1978/MB-Lab/issues/286, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKYHC3V35C4OUCUSR7ROWZDR3PXHPANCNFSM4OZFLLSA .

animate1978 commented 4 years ago

@TetoTheSquirrelFox strange; I've just spun up blender again, I haven't changed anything; still using the development version of mblab and the same version of blender; but it works now

Hmm strange. However great that it seems to work!

Tylertron1998 commented 4 years ago

just to clarify; what works is just the plugin - not the hair dynamics, unfortunately.

Tylertron1998 commented 4 years ago

Alright, I've just tested with a different windows machine, on the dev version of MB-Lab and blender 2.82 LTS, and hair dynamics is working. So it's an issue with my machine... but I cannot figure out what. It's so strange that it doesn't work specifically with the hair provided via the tool.

animate1978 commented 4 years ago

Could you provide a system info report on the problematic machine?

In Blender goto 'Help' then 'Save System Info'

Tylertron1998 commented 4 years ago

system-info.txt

here you are!

I just had a read, and it doesn't mention I'm on a preview/insider version of windows. I'll be rolling back soon anyway.

animate1978 commented 4 years ago

OK.

Before I go for the day I was poking around on the Blender Dev site, looking at bugs related to Hair Dynamics. I could go out on a limb and suggest it may be an Nvidia issue... but that seems to be a long shot. I personally have an AMD card so I cannot verify for sure.

https://developer.blender.org/T68681

It still doesn't make sense though why the simulation does not work IF it is related to the Nvidia driver? This issue in this bug above is more related to redraw routines... not in your case where it just doesn't function. If I recall you said you can create a simple object, such as a sphere, attach hair and the dynamic simulation functions as expected.

I will continue to try to find the source of this bug and if all else fails, submit a bug report to the Blender Dev's. I've already posted some requests for help regarding this matter elsewhere so I am just waiting to hear some responses...

Tylertron1998 commented 4 years ago

Also, to note; simulation works for everything but the mesh created by the hair tool within mblab (I'd imagine if it were a driver or hardware issue it would not work at all?) - and also, the other machine I tested on and got it working is running an Nvidia card (GTX 1060) so, that layers the confusion even deeper.

Tylertron1998 commented 4 years ago

Hm. They do mention smooth shading here though.. let me test that.

Tylertron1998 commented 4 years ago

AHA! That is the issue. Smooth shading breaks (specifically on my machine) hair dynamics. Adding a primitive with smooth shading does not simulate; however, a primitive WITHOUT smooth shading does simulate.

Tylertron1998 commented 4 years ago

Just tested on the problematic machine with the mblab hair tool, and I set the generated mesh to flat shading, and dynamics works!

So this does appear to be an issue within blender itself (thank goodness). On a side note, considering the actual underlying mesh is never seen anyway, would it not be a good idea to shade it flat by default?

Let me know if you'd like me to close this issue, as we now know it is not related to MBLab, rather, Blender itself.

animate1978 commented 4 years ago

I think that might be a good idea - regarding the hair mesh object, I think I will delve into the code.

Keep it open for now so that if this issue is brought up to the Blender dev's that they can see it.

Tylertron1998 commented 4 years ago

Awesome! Thank you so so much for your help here; you've been truly wonderful!

Noizirom commented 4 years ago

It shouldn't be a hard fix, just remove the line that sets the shade smooth.

On Wed, Jul 15, 2020, 9:43 AM animate1978 notifications@github.com wrote:

I think that might be a good idea - regarding the hair mesh object, I think I will delve into the code.

Keep it open for now so that if this issue is brought up to the Blender dev's that they can see it.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/animate1978/MB-Lab/issues/286#issuecomment-658775738, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKYHC3STPTB2DDUMFOF6ZH3R3WW7NANCNFSM4OZFLLSA .

animate1978 commented 4 years ago

Closing this issue as the "bug" was fixed in latest commit to the dev branch.