Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
nifplg
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
nifplg
Commits
e37af671
Commit
e37af671
authored
18 years ago
by
Tazpn
Browse files
Options
Downloads
Patches
Plain Diff
Fix issue when importing Nifs without a scene NiNode
parent
fc4f3c86
No related branches found
Branches containing commit
No related tags found
Tags containing commit
Loading
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
NifImport/MaxNifImport.rc
+4
-4
4 additions, 4 deletions
NifImport/MaxNifImport.rc
NifImport/MaxNifImport.vcproj
+11
-11
11 additions, 11 deletions
NifImport/MaxNifImport.vcproj
NifImport/NIFImport.cpp
+34
-22
34 additions, 22 deletions
NifImport/NIFImport.cpp
with
49 additions
and
37 deletions
NifImport/MaxNifImport.rc
+
4
−
4
View file @
e37af671
...
...
@@ -88,8 +88,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 0,1,
4,6
PRODUCTVERSION 0,1,
4
,0
FILEVERSION 0,1,
6,8
PRODUCTVERSION 0,1,
6
,0
FILEFLAGSMASK 0x37L
#ifdef _DEBUG
FILEFLAGS 0x21L
...
...
@@ -105,12 +105,12 @@ BEGIN
BLOCK "040904b0"
BEGIN
VALUE "FileDescription", "3ds Max Nif Importer"
VALUE "FileVersion", "0, 1,
4
,
6
"
VALUE "FileVersion", "0, 1,
6
,
8
"
VALUE "InternalName", "MaxNifImport.dli"
VALUE "LegalCopyright", "Copyright (c) 2006, NIF File Format Library and Tools\r\nAll rights reserved."
VALUE "OriginalFilename", "MaxNifImport.dli"
VALUE "ProductName", "3ds Max Nif Importer"
VALUE "ProductVersion", "0, 1,
4
, 0"
VALUE "ProductVersion", "0, 1,
6
, 0"
VALUE "SpecialBuild", "Alpha"
END
END
...
...
This diff is collapsed.
Click to expand it.
NifImport/MaxNifImport.vcproj
+
11
−
11
View file @
e37af671
...
...
@@ -58,9 +58,9 @@
ForceConformanceInForLoopScope=
"false"
UsePrecompiledHeader=
"2"
PrecompiledHeaderFile=
".\Release\MaxNifImport.pch"
AssemblerListingLocation=
".\Release\"
ObjectFile=
".\Release\"
ProgramDataBaseFileName=
".\Release\"
AssemblerListingLocation=
".\Release
7
\"
ObjectFile=
".\Release
7
\"
ProgramDataBaseFileName=
".\Release
7
\"
WarningLevel=
"3"
SuppressStartupBanner=
"true"
DebugInformationFormat=
"3"
...
...
@@ -86,13 +86,13 @@
SuppressStartupBanner=
"true"
AdditionalLibraryDirectories=
"C:\3dsmax7\maxsdk\lib"
ModuleDefinitionFile=
".\MaxNifImport.def"
ProgramDatabaseFile=
".\Release\MaxNifImport.pdb"
ProgramDatabaseFile=
".\Release
7
\MaxNifImport.pdb"
SubSystem=
"2"
OptimizeReferences=
"2"
EnableCOMDATFolding=
"2"
SetChecksum=
"true"
BaseAddress=
"0x16860000"
ImportLibrary=
".\Release\MaxNifImport.lib"
ImportLibrary=
".\Release
7
\MaxNifImport.lib"
/>
<Tool
Name=
"VCALinkTool"
...
...
@@ -160,10 +160,10 @@
RuntimeLibrary=
"1"
ForceConformanceInForLoopScope=
"false"
UsePrecompiledHeader=
"2"
PrecompiledHeaderFile=
".\Debug\MaxNifImport.pch"
AssemblerListingLocation=
".\Debug\"
ObjectFile=
".\Debug\"
ProgramDataBaseFileName=
".\Debug\"
PrecompiledHeaderFile=
".\Debug
7
\MaxNifImport.pch"
AssemblerListingLocation=
".\Debug
7
\"
ObjectFile=
".\Debug
7
\"
ProgramDataBaseFileName=
".\Debug
7
\"
WarningLevel=
"3"
SuppressStartupBanner=
"true"
DebugInformationFormat=
"3"
...
...
@@ -191,10 +191,10 @@
IgnoreDefaultLibraryNames=
"msvcrtd.lib"
ModuleDefinitionFile=
".\MaxNifImport.def"
GenerateDebugInformation=
"true"
ProgramDatabaseFile=
".\Debug\MaxNifImport.pdb"
ProgramDatabaseFile=
".\Debug
7
\MaxNifImport.pdb"
SubSystem=
"2"
BaseAddress=
"0x16860000"
ImportLibrary=
".\Debug\MaxNifImport.lib"
ImportLibrary=
".\Debug
7
\MaxNifImport.lib"
/>
<Tool
Name=
"VCALinkTool"
...
...
This diff is collapsed.
Click to expand it.
NifImport/NIFImport.cpp
+
34
−
22
View file @
e37af671
...
...
@@ -182,8 +182,6 @@ INode *NifImporter::GetNode(Niflib::NiNodeRef node)
bool
NifImporter
::
DoImport
()
{
bool
ok
=
true
;
NiNodeRef
rootNode
=
root
;
vector
<
string
>
importedBones
;
if
(
!
isBiped
&&
importSkeleton
&&
importBones
)
{
...
...
@@ -233,30 +231,44 @@ bool NifImporter::DoImport()
}
if
(
isValid
())
{
if
(
importBones
)
{
if
(
strmatch
(
rootNode
->
GetName
(),
"Scene Root"
))
ImportBones
(
DynamicCast
<
NiNode
>
(
rootNode
->
GetChildren
()));
else
ImportBones
(
rootNode
);
}
ok
=
ImportMeshes
(
rootNode
);
if
(
importSkeleton
&&
removeUnusedImportedBones
){
vector
<
string
>
importedNodes
=
GetNamesOfNodes
(
nodes
);
sort
(
importedBones
.
begin
(),
importedBones
.
end
());
sort
(
importedNodes
.
begin
(),
importedNodes
.
end
());
vector
<
string
>
results
;
results
.
resize
(
importedBones
.
size
());
vector
<
string
>::
iterator
end
=
set_difference
(
importedBones
.
begin
(),
importedBones
.
end
(),
importedNodes
.
begin
(),
importedNodes
.
end
(),
results
.
begin
());
for
(
vector
<
string
>::
iterator
itr
=
results
.
begin
();
itr
!=
end
;
++
itr
){
if
(
INode
*
node
=
gi
->
GetINodeByName
((
*
itr
).
c_str
())){
node
->
Delete
(
0
,
TRUE
);
if
(
root
->
IsDerivedType
(
NiNode
::
TypeConst
()))
{
NiNodeRef
rootNode
=
root
;
if
(
importBones
)
{
if
(
strmatch
(
rootNode
->
GetName
(),
"Scene Root"
))
ImportBones
(
DynamicCast
<
NiNode
>
(
rootNode
->
GetChildren
()));
else
ImportBones
(
rootNode
);
}
ok
=
ImportMeshes
(
rootNode
);
if
(
importSkeleton
&&
removeUnusedImportedBones
){
vector
<
string
>
importedNodes
=
GetNamesOfNodes
(
nodes
);
sort
(
importedBones
.
begin
(),
importedBones
.
end
());
sort
(
importedNodes
.
begin
(),
importedNodes
.
end
());
vector
<
string
>
results
;
results
.
resize
(
importedBones
.
size
());
vector
<
string
>::
iterator
end
=
set_difference
(
importedBones
.
begin
(),
importedBones
.
end
(),
importedNodes
.
begin
(),
importedNodes
.
end
(),
results
.
begin
());
for
(
vector
<
string
>::
iterator
itr
=
results
.
begin
();
itr
!=
end
;
++
itr
){
if
(
INode
*
node
=
gi
->
GetINodeByName
((
*
itr
).
c_str
())){
node
->
Delete
(
0
,
TRUE
);
}
}
}
}
else
if
(
root
->
IsDerivedType
(
NiTriShape
::
TypeConst
()))
{
ok
|=
ImportMesh
(
NiTriShapeRef
(
root
));
}
else
if
(
root
->
IsDerivedType
(
NiTriStrips
::
TypeConst
()))
{
ok
|=
ImportMesh
(
NiTriStripsRef
(
root
));
}
}
...
...
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