About Store Forum Documentation Contact



Post Reply 
MMO's character : mesh animated with CHR's cskel
Author Message
gdalex Offline
Member

Post: #1
MMO's character : mesh animated with CHR's cskel
Hi,

I have some issues when I try to draw my CHR's cloth smile
First things first : my cloth has been animated in Maya with the same skeleton used for my CHR mesh.
The idea was to apply the same cskel to my cloth so that it would be drawn exactly at the right moment at the right position.

I placed my cloth drawing in the Inventory class of the MMO code.

In the update function :

Code:
void update(CSkeleton &cskel, Chr *owner)
{
[...]
if (valid(SLOT_BODY))
      {
         Item   &item  =T.item(slots[SLOT_BODY]);
         if (item.type == EQUIP_BASE)
         {
            if(C OrientP *point=cskel.findPoint(8"Base")) // Name of my parent bone's slot.
            {
               //Nothing to be updated here, see draw functions
            }
        
         }
        
      }
}

Code:
// draw
   uint drawPrepare(CSkeleton &cskel)
   {
      // draw items in hands
      uint modes=0;
      if(valid(SLOT_ARM_L))
         modes|=item(slots[SLOT_ARM_L]).drawPrepare();
      if(valid(SLOT_ARM_R))
         modes|=item(slots[SLOT_ARM_R]).drawPrepare();
      if(valid(SLOT_HEAD))
         modes|=item(slots[SLOT_HEAD]).drawPrepare();
      if(valid(SLOT_BODY))
         modes|=item(slots[SLOT_BODY]).drawPrepare(cskel); // We're using the CHR's cskel without any fear...
      return modes;
   }
   void drawShadow(CSkeleton &cskel)
   {
      // draw items in hands
      if(valid(SLOT_ARM_L))
         item(slots[SLOT_ARM_L]).drawShadow();
      if(valid(SLOT_ARM_R))
         item(slots[SLOT_ARM_R]).drawShadow();
      if(valid(SLOT_HEAD))
         item(slots[SLOT_HEAD]).drawShadow();
      if(valid(SLOT_BODY))
         item(slots[SLOT_BODY]).drawShadow(cskel);
   }


The problem is that sometimes the cloth isn't drawn(the character is naked.)
Could it be a problem if cskel update ?
Or bad init ?

Thanks for your help !
01-08-2014 08:18 PM
Find all posts by this user Quote this message in a reply
gdalex Offline
Member

Post: #2
RE: MMO's character : mesh animated with CHR's cskel
Any ideas what could cause the equipped item not being drawn (from time to time) in the DrawPrepare function, when the CHR's cskel is used ? :/
02-06-2014 01:56 PM
Find all posts by this user Quote this message in a reply
Post Reply