Animation layering
Re: Animation layering
Is the old weapon being removed with removeIndividualPart()?
Re: Animation layering
You, my friend, are awesome.Chris wrote:Have a treat.
Re: Animation layering
Congrats! Looks good!Chris wrote:Have a treat.
Re: Animation layering
Amazing work!
Re: Animation layering
It should be. The weapon is added withjhooks1 wrote:Is the old weapon being removed with removeIndividualPart()?
Code: Select all
addOrReplaceIndividualPart(ESM::PRT_Weapon, MWWorld::InventoryStore::Slot_CarriedRight, 1, mesh);
Code: Select all
removePartGroup(slotlist[i].mSlot);
Re: Animation layering
Not sure what is wrong then. The algorithm looks very different than what I originally committed. Might want to add a remove in showWeapons() before the addOrReplace()
removePartGroup(slotlist.mSlot); could be placed in the forceupdate loop (you would have to get rid of the break statement though). Only the part groups that have changed need to be removed. That is how it was originally (more efficient I think, rather than removing slots that have not changed). Did you guys run into problems with the original approach? I made the updateParts() function priority based so you would not have to remove every part group.
Layering looks great though
EDIT:
I would do this
Again, I don't know if it will help anything.
EDIT2: Not sure why priority is based on number of reserved slots either. Originally it was - 5 for Robes, 4 for Skirts, 3 for Armor, 2 for other clothing, and 1 for skin.
removePartGroup(slotlist.mSlot); could be placed in the forceupdate loop (you would have to get rid of the break statement though). Only the part groups that have changed need to be removed. That is how it was originally (more efficient I think, rather than removing slots that have not changed). Did you guys run into problems with the original approach? I made the updateParts() function priority based so you would not have to remove every part group.
Layering looks great though
EDIT:
I would do this
Code: Select all
void NpcAnimation::showWeapons(bool showWeapon)
{
mShowWeapons = showWeapon;
removeIndividualPart(ESM::PRT_Weapon);
if(showWeapon)
{
MWWorld::InventoryStore &inv = MWWorld::Class::get(mPtr).getInventoryStore(mPtr);
mWeapon = inv.getSlot(MWWorld::InventoryStore::Slot_CarriedRight);
if(mWeapon != inv.end()) // special case for weapons
{
std::string mesh = MWWorld::Class::get(*mWeapon).getModel(*mWeapon);
addOrReplaceIndividualPart(ESM::PRT_Weapon, MWWorld::InventoryStore::Slot_CarriedRight, 1, mesh);
}
}
}
EDIT2: Not sure why priority is based on number of reserved slots either. Originally it was - 5 for Robes, 4 for Skirts, 3 for Armor, 2 for other clothing, and 1 for skin.