Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Max Nif Plugin
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Grant Kim
Max Nif Plugin
Commits
244fb632
Commit
244fb632
authored
18 years ago
by
Gundalf
Browse files
Options
Downloads
Patches
Plain Diff
Fixed groups
parent
a6425611
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
NifExport/Coll.cpp
+4
-2
4 additions, 2 deletions
NifExport/Coll.cpp
NifExport/Exporter.h
+4
-0
4 additions, 0 deletions
NifExport/Exporter.h
NifExport/Mesh.cpp
+4
-28
4 additions, 28 deletions
NifExport/Mesh.cpp
NifExport/Util.cpp
+47
-0
47 additions, 0 deletions
NifExport/Util.cpp
with
59 additions
and
30 deletions
NifExport/Coll.cpp
+
4
−
2
View file @
244fb632
...
...
@@ -242,8 +242,10 @@ bool Exporter::makeCollisionHierarchy(NiNodeRef &parent, INode *node, TimeValue
Exporter
::
Result
Exporter
::
exportCollision
(
NiNodeRef
&
parent
,
INode
*
node
)
{
// marked as collision?
bool
coll
=
npIsCollision
(
node
);
NiNodeRef
newParent
;
if
(
npIsCollision
(
node
)
)
if
(
coll
)
{
/* NiNodeRef n = DynamicCast<NiNode>(CreateBlock("NiNode"));
parent->AddChild(DynamicCast<NiAVObject>(n));
...
...
@@ -279,7 +281,7 @@ Exporter::Result Exporter::exportCollision(NiNodeRef &parent, INode *node)
newParent
->
SetCollisionObject
(
DynamicCast
<
NiCollisionObject
>
(
co
));
}
else
if
(
node
->
IsGroupHead
(
))
if
(
isCollisionGroup
(
node
))
{
newParent
=
makeNode
(
parent
,
node
);
}
else
...
...
This diff is collapsed.
Click to expand it.
NifExport/Exporter.h
+
4
−
0
View file @
244fb632
...
...
@@ -88,6 +88,10 @@ private:
BitmapTex
*
getTexture
(
Mtl
*
mtl
);
void
getTextureMatrix
(
Matrix3
&
mat
,
Mtl
*
mtl
);
NiNodeRef
makeNode
(
NiNodeRef
&
parent
,
INode
*
maxNode
,
bool
local
=
true
);
// returns true if the node contains collision objects
bool
isCollisionGroup
(
INode
*
maxNode
,
bool
root
=
true
);
// returns true if the node contains meshes
bool
isMeshGroup
(
INode
*
maxNode
,
bool
root
=
true
);
/* tristrips */
void
strippify
(
TriStrips
&
strips
,
vector
<
Vector3
>
&
verts
,
vector
<
Vector3
>
&
norms
,
const
Triangles
&
tris
);
...
...
This diff is collapsed.
Click to expand it.
NifExport/Mesh.cpp
+
4
−
28
View file @
244fb632
...
...
@@ -43,28 +43,14 @@ void FPUtility::GetAlphaVal(void)
Exporter
::
Result
Exporter
::
exportMeshes
(
NiNodeRef
&
parent
,
INode
*
node
)
{
bool
coll
=
npIsCollision
(
node
);
if
((
coll
&&
!
mExportCollision
)
||
(
node
->
IsHidden
()
&&
!
mExportHidden
&&
!
coll
)
||
(
mSelectedOnly
&&
!
node
->
Selected
()))
if
(
coll
||
(
node
->
IsHidden
()
&&
!
mExportHidden
&&
!
coll
)
||
(
mSelectedOnly
&&
!
node
->
Selected
()))
return
Skip
;
NiNodeRef
newParent
;
TimeValue
t
=
0
;
ObjectState
os
=
node
->
EvalWorldState
(
t
);
if
(
!
coll
&&
os
.
obj
&&
os
.
obj
->
SuperClassID
()
==
GEOMOBJECT_CLASS_ID
)
if
(
os
.
obj
&&
os
.
obj
->
SuperClassID
()
==
GEOMOBJECT_CLASS_ID
)
{
/* newParent = DynamicCast<NiNode>(CreateBlock("NiNode"));
parent->AddChild(DynamicCast<NiAVObject>(newParent));
Matrix33 rot;
Vector3 trans;
nodeTransform(rot, trans, node, t);
newParent->SetLocalRotation(rot);
newParent->SetLocalTranslation(trans);
string name = (char*)node->GetName();
newParent->SetName(name);
*/
newParent
=
makeNode
(
parent
,
node
);
Result
result
;
...
...
@@ -73,20 +59,10 @@ Exporter::Result Exporter::exportMeshes(NiNodeRef &parent, INode *node)
return
result
;
}
else
if
(
node
->
IsGroupHead
(
))
if
(
isMeshGroup
(
node
))
{
newParent
=
makeNode
(
parent
,
node
);
/* newParent = DynamicCast<NiNode>(CreateBlock("NiNode"));
Matrix33 rot;
Vector3 trans;
nodeTransform(rot, trans, node, t);
newParent->SetLocalRotation(rot);
newParent->SetLocalTranslation(trans);
string name = (char*)node->GetName();
newParent->SetName(name);
parent->AddChild(DynamicCast<NiAVObject>(newParent));
*/
}
else
newParent
=
parent
;
...
...
This diff is collapsed.
Click to expand it.
NifExport/Util.cpp
+
47
−
0
View file @
244fb632
...
...
@@ -105,3 +105,50 @@ NiNodeRef Exporter::makeNode(NiNodeRef &parent, INode *maxNode, bool local)
parent
->
AddChild
(
DynamicCast
<
NiAVObject
>
(
node
));
return
node
;
}
bool
Exporter
::
isCollisionGroup
(
INode
*
maxNode
,
bool
root
)
{
if
(
root
)
{
if
(
!
maxNode
->
IsGroupHead
())
return
false
;
}
else
{
if
(
npIsCollision
(
maxNode
))
return
true
;
}
for
(
int
i
=
0
;
i
<
maxNode
->
NumberOfChildren
();
i
++
)
{
if
(
isCollisionGroup
(
maxNode
->
GetChildNode
(
i
),
false
))
return
true
;
}
return
false
;
}
bool
Exporter
::
isMeshGroup
(
INode
*
maxNode
,
bool
root
)
{
if
(
root
)
{
if
(
!
maxNode
->
IsGroupHead
())
return
false
;
}
else
{
if
(
!
npIsCollision
(
maxNode
))
{
TimeValue
t
=
0
;
ObjectState
os
=
maxNode
->
EvalWorldState
(
t
);
if
(
os
.
obj
->
SuperClassID
()
==
GEOMOBJECT_CLASS_ID
)
return
true
;
}
}
for
(
int
i
=
0
;
i
<
maxNode
->
NumberOfChildren
();
i
++
)
{
if
(
isMeshGroup
(
maxNode
->
GetChildNode
(
i
),
false
))
return
true
;
}
return
false
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment