Armour/Clothing rendering

Everything about development and the OpenMW source code.
User avatar
lgromanowski
Site Admin
Posts: 1193
Joined: 05 Aug 2011, 22:21
Location: Wroclaw, Poland
Contact:

Re: Armour/Clothing rendering

Post by lgromanowski »

There is some warning when compiling clothingarmor branch:

Code: Select all

openmw/apps/openmw/mwrender/npcanimation.cpp: In member function ‘void MWRender::NpcAnimation::addPartGroup(int, int, std::vector<ESM::PartReference>&)’:
openmw/apps/openmw/mwrender/npcanimation.cpp:825:39: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
there is for-lop with i counter variable which should be changed to unsigned int / size_t.

There are also some errors with boost::any_cast as Zini posted, and with NPC rendering:

Image
NPC is without legs, and Fargoth is only with his pants.
jhooks1
Posts: 780
Joined: 06 Aug 2011, 21:34

Re: Armour/Clothing rendering

Post by jhooks1 »

Could be this:
if(boots->getTypeName() == "struct ESM::Clothing"){
const ESM::Clothing *clothes = (boots->get<ESM::Clothing>())->base;
std::vector<ESM::PartReference> parts = clothes->parts.parts;
addPartGroup(MWWorld::InventoryStore::Slot_Boots, 2, parts);
}
else
{
const ESM::Armor *armor = (boots->get<ESM::Armor>())->base;
std::vector<ESM::PartReference> parts = armor->parts.parts;
addPartGroup(MWWorld::InventoryStore::Slot_Boots, 3, parts);
}

I am not getting any errors, but I am guessing what I did here was not correct?
User avatar
scrawl
Posts: 2152
Joined: 18 Feb 2012, 11:51

Re: Armour/Clothing rendering

Post by scrawl »

if(boots->getTypeName() == "struct ESM::Clothing"){

not sure if this is portable, normally you would use


if(boots->getTypeName() == typeid(ESM::Clothing).name()){

I could be wrong though.

Edit: tried out and made no difference :/
User avatar
scrawl
Posts: 2152
Joined: 18 Feb 2012, 11:51

Re: Armour/Clothing rendering

Post by scrawl »

NPC is without legs, and Fargoth is only with his pants.
Fargoth has no clothes at all here, so maybe its an localization issue?
User avatar
lgromanowski
Site Admin
Posts: 1193
Joined: 05 Aug 2011, 22:21
Location: Wroclaw, Poland
Contact:

Re: Armour/Clothing rendering

Post by lgromanowski »

jhooks1 wrote:Could be this:
if(boots->getTypeName() == "struct ESM::Clothing"){
const ESM::Clothing *clothes = (boots->get<ESM::Clothing>())->base;
std::vector<ESM::PartReference> parts = clothes->parts.parts;
addPartGroup(MWWorld::InventoryStore::Slot_Boots, 2, parts);
}
else
{
const ESM::Armor *armor = (boots->get<ESM::Armor>())->base;
std::vector<ESM::PartReference> parts = armor->parts.parts;
addPartGroup(MWWorld::InventoryStore::Slot_Boots, 3, parts);
}

I am not getting any errors, but I am guessing what I did here was not correct?
Some std::cout with boots/gloves getTypeName() prints:

Code: Select all

Boots typename: N3ESM8ClothingE
Left glove typename: N3ESM5ArmorE
Right glove typename: N3ESM5ArmorE
User avatar
scrawl
Posts: 2152
Joined: 18 Feb 2012, 11:51

Re: Armour/Clothing rendering

Post by scrawl »

I replaced the typename checks in my branch npcclothing. This fixed the missing clothes on NPCs, and I'm not getting boost::bad any_cast warnings anymore. However the guy on the seyda neen boat still has no legs.
jhooks1
Posts: 780
Joined: 06 Aug 2011, 21:34

Re: Armour/Clothing rendering

Post by jhooks1 »

I just realized the no leg problem, seems to mainly happen with leather boots. Just checked the leather boots out in nifskope, they contain a skeleton (up to now I had only seen boots without a skeleton). I need to implement them in a similar way as beast feet.
User avatar
werdanith
Posts: 295
Joined: 26 Aug 2011, 16:18

Re: Armour/Clothing rendering

Post by werdanith »

There seems to be some rendering issue with Desele's neck in The House of Earthly Delights in Suran.
jhooks1
Posts: 780
Joined: 06 Aug 2011, 21:34

Re: Armour/Clothing rendering

Post by jhooks1 »

That is the skirt she is wearing, it has that piece on the top in the skirt file. Morrowind doesn't display it at all, we may be able to check for the shape name and not display it. Seems to be a minor issue for now.
jhooks1
Posts: 780
Joined: 06 Aug 2011, 21:34

Re: Armour/Clothing rendering

Post by jhooks1 »

Ok, I think I fixed the problem with the pair of boots with my latest commit.
Post Reply