WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Adding custom floating hand avatar (https://forum.worldviz.com/showthread.php?t=6071)

seowen1 10-17-2017 07:27 AM

Adding custom floating hand avatar
 
1 Attachment(s)
Hi there,

I am in the process of trying to create and utilize a custom avatar for a disconnected hand. This would be similar to the "Head and Hands" avatar within vizconnect.

I'm still pretty new to Vizard and python, but I'm pretty well versed in 3ds max, so the model is already created/rigged and exported as a CFG via the Cal3D exporter. It seems like the model is in working order, since I can open the CFG in Inspector and it looks good. I can even use:

HTML Code:

handTest = vizfx.addAvatar('<filepath>/Tactical_GloveRight.cfg')
And it will load in and look fine. Where I am confused is how I go about adding this in as an Avatar to replace the hand/glove model. I did replace the model filepath with my new one in the vizconnect file, and it loads but it is a black model with no apparent textures. Almost as if the Effects aren't applied on the model (like if you load it with "viz" instead of "vizfx"). I am using a scene without any light source, but the texture for the glove has a self-illumination complete map baked in that appears just fine with the vizfx.addAvatar() command, as previously mentioned.

Also I'm getting a bunch of errors referencing the bone names:

HTML Code:

** ERROR: Bone with name 'END thumb' does not exist
** ERROR: Bone with name 'END index' does not exist
** ERROR: Bone with name 'END middle' does not exist
** ERROR: Bone with name 'END ring' does not exist
** ERROR: Bone with name 'END little' does not exist
** ERROR: Bone with name 'bone thumb ROOT' does not exist
** ERROR: Bone with name 'bone thumb 0-0' does not exist
** ERROR: Bone with name 'bone thumb 0-1' does not exist
** ERROR: Bone with name 'bone index 1-0' does not exist
** ERROR: Bone with name 'bone index 1-1' does not exist
** ERROR: Bone with name 'bone index 1-2' does not exist
** ERROR: Bone with name 'bone middle 2-0' does not exist
** ERROR: Bone with name 'bone middle 2-1' does not exist
** ERROR: Bone with name 'bone middle 2-2' does not exist
** ERROR: Bone with name 'bone ring 3-0' does not exist
** ERROR: Bone with name 'bone ring 3-1' does not exist
** ERROR: Bone with name 'bone ring 3-2' does not exist
** ERROR: Bone with name 'bone little 4-0' does not exist
** ERROR: Bone with name 'bone little 4-1' does not exist
** ERROR: Bone with name 'bone little 4-2' does not exist
** ERROR: Bone with name 'bone WRIST' does not exist

Which is weird to me because I thought the code would pull the bone names from the skeleton file instead of having them hardcoded to the old skeleton bone names. I even tried to edit the hardcoded names within HandModel() class of the hand.py file to no effect.

Can anyone tell me what I'm doing wrong? I really want to get this new model working as we want something different than the default "Mickey Mouse Glove" as we call it internally. Thanks!

Jeff 10-17-2017 06:17 PM

After changing the name of the model file for the head and hands avatar in the vizconnect file:

Code:

rightHandFilename = 'Tactical_GloveRight.cfg'
Change the code where the model is added from:
Code:

if rightHandFilename:
        rightHand = avatar.add(rightHandFilename)
        avatar.rightHandFilename = rightHandFilename

to:
Code:

if rightHandFilename:
        rightHand = vizfx.addAvatar(rightHandFilename)
        rightHand.setParent(avatar)
        avatar.rightHandFilename = rightHandFilename

In order for the gestures to work, the bones names of your hand model should match the names of the included glove model.

seowen1 10-18-2017 07:23 AM

Hi Jeff,

Thank you for the quick response. I fixed the skeleton by naming the bones correctly, but I'm still having issues viewing the model correctly as the hand avatar.

I still get the black texture/no effect look even when I implement your solution with import vizfx. I'm not sure if there is something else going on here. It's almost as if the self-illumination isn't showing. If I export the material file and leave only the self-illumination map on (removing the diffuse map) the model loads black in the inspector.

I have a ZIP file I could send you for troubleshooting? I tried uploading it here but it probably doesn't accept zip files or my texture is too large perhaps.

seowen1 10-18-2017 09:41 AM

1 Attachment(s)
Okay so I have been messing with some of the material settings, trying to solve the issue. I did notice that if I set the diffuse color to red, I will get a red tinge to the avatar so that it shows mostly black with some soft red on some edges.

Attached are the settings I am using now that seem correct, but are still rendering the black model. I noticed that having the texture for the complete map in both the diffuse AND self-illumination slots was giving off a weird compounded effect. Took me awhile to figure that one out since I thought it was related to gamma settings.

Still having the main issue though. As mentioned before, I would gladly send my files over and give you a better way to troubleshoot.

Jeff 10-18-2017 11:29 AM

Yes, please upload the zipped file with resources and example vizconnect script for us to look at.

Jeff 10-18-2017 11:37 AM

Also wanted to mention that in addition to the head and hands avatar the 'Mark' avatar includes a robotic hand model. In case you have not seen it that maybe an option for you.

seowen1 10-18-2017 12:00 PM

I just submitted the upload. #1790457 for your reference.

I realize the skeleton isn't oriented correctly. I'm probably just going to reskin the model in an attempt to correct some other issues anyway. I assume I will just need to rotate the bones to fix this.

In the meantime, I just want to make sure that I can get the model working.

Thanks for the help, Jeff!

Also, I am aware of the other hand models you have available. We are just interested in a custom version.

Jeff 10-27-2017 02:56 PM

When gestures are applied, the model is added through the hand.py module. Create a copy of hand.py, place that in the same folder as the vizconnect file, and change the line of code that adds the model in the __init__ method of the HandModel class to:

Code:

#Initialize base class
import vizfx
hand = vizfx.addAvatar(file,**kw)
viz.VizAvatar.__init__(self,hand.id)
viz.EventClass.__init__(self)


seowen1 10-27-2017 02:59 PM

Thanks, Jeff. I will definitely try that out!


All times are GMT -7. The time now is 06:10 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Copyright 2002-2018 WorldViz LLC