Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

import modifier bugfixes #14

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ Build/Debug
_UpgradeReport_Files
x64
Debug
/Build
/ipch/nifplugins_vc2008-4447fb5f
/NifPlugins_VC2010.sdf
13 changes: 8 additions & 5 deletions NifCommon/niutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -804,13 +804,16 @@ Modifier *GetOrCreateSkin(INode *node)
Modifier *skinMod = GetSkin(node);
if (skinMod)
return skinMod;

IDerivedObject *dobj = CreateDerivedObject(node->GetObjectRef());
Object *pObj = node->GetObjectRef();
IDerivedObject *pDerObj = NULL;
if (pObj->SuperClassID() == GEN_DERIVOB_CLASS_ID)
pDerObj = static_cast<IDerivedObject*>(pObj);
else pDerObj = CreateDerivedObject(pObj);
//create a skin modifier and add it
skinMod = (Modifier*) CreateInstance(OSM_CLASS_ID, SKIN_CLASSID);
dobj->SetAFlag(A_LOCK_TARGET);
dobj->AddModifier(skinMod);
dobj->ClearAFlag(A_LOCK_TARGET);
pDerObj->SetAFlag(A_LOCK_TARGET);
pDerObj->AddModifier(skinMod);
pDerObj->ClearAFlag(A_LOCK_TARGET);
node->SetObjectRef(dobj);
return skinMod;
}
Expand Down
19 changes: 12 additions & 7 deletions NifProps/Modifier/BSDismemberSkin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2510,19 +2510,24 @@ void BSDSModifier::SelectUnused()
ip->RedrawViews(ip->GetTime());
}

// Get or Create the Skin Modifier
// Get or Create the BSDismember Modifier
Modifier *GetOrCreateBSDismemberSkin(INode *node)
{
Modifier *skinMod = GetBSDismemberSkin(node);
if (skinMod)
return skinMod;

IDerivedObject *dobj = CreateDerivedObject(node->GetObjectRef());
//create a skin modifier and add it
Object *pObj = node->GetObjectRef();
IDerivedObject *pDerObj = NULL;
if (pObj->SuperClassID() == GEN_DERIVOB_CLASS_ID)
pDerObj = static_cast<IDerivedObject*>(pObj);
else {
pDerObj = CreateDerivedObject(pObj);
}
//create a BSDismember modifier and add it
skinMod = (Modifier*) CreateInstance(OSM_CLASS_ID, BSDSMODIFIER_CLASS_ID);
dobj->SetAFlag(A_LOCK_TARGET);
dobj->AddModifier(skinMod);
dobj->ClearAFlag(A_LOCK_TARGET);
pDerObj->SetAFlag(A_LOCK_TARGET);
pDerObj->AddModifier(skinMod);
pDerObj->ClearAFlag(A_LOCK_TARGET);
node->SetObjectRef(dobj);
return skinMod;
}
Expand Down