Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Courses
Scotty3D
Commits
768c19db
Commit
768c19db
authored
Sep 30, 2020
by
TheNumbat
Browse files
drop normals on scene load
parent
5ab1f82f
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/scene/scene.cpp
View file @
768c19db
...
@@ -314,11 +314,6 @@ static void load_node(Scene &scobj, std::vector<std::string> &errors,
...
@@ -314,11 +314,6 @@ static void load_node(Scene &scobj, std::vector<std::string> &errors,
}
}
}
}
if
(
!
mesh
->
HasNormals
())
{
errors
.
push_back
(
"Mesh has no normals."
);
continue
;
}
std
::
vector
<
Vec3
>
verts
;
std
::
vector
<
Vec3
>
verts
;
for
(
unsigned
int
j
=
0
;
j
<
mesh
->
mNumVertices
;
j
++
)
{
for
(
unsigned
int
j
=
0
;
j
<
mesh
->
mNumVertices
;
j
++
)
{
...
@@ -500,10 +495,11 @@ std::string Scene::load(bool new_scene, Undo &undo, Gui::Manager &gui, std::stri
...
@@ -500,10 +495,11 @@ std::string Scene::load(bool new_scene, Undo &undo, Gui::Manager &gui, std::stri
Assimp
::
Importer
importer
;
Assimp
::
Importer
importer
;
const
aiScene
*
scene
=
importer
.
ReadFile
(
const
aiScene
*
scene
=
importer
.
ReadFile
(
file
.
c_str
(),
aiProcess_GenSmoothNormals
|
aiProcess_PopulateArmatureData
|
file
.
c_str
(),
aiProcess_PopulateArmatureData
|
aiProcess_FixInfacingNormals
|
aiProcess_ValidateDataStructure
|
aiProcess_OptimizeMeshes
|
aiProcess_ValidateDataStructure
|
aiProcess_OptimizeMeshes
|
aiProcess_FindInstances
|
aiProcess_FindDegenerates
|
aiProcess_FindInstances
|
aiProcess_FindDegenerates
|
aiProcess_JoinIdenticalVertices
|
aiProcess_FindInvalidData
);
aiProcess_DropNormals
|
aiProcess_JoinIdenticalVertices
|
aiProcess_FindInvalidData
);
if
(
!
scene
)
{
if
(
!
scene
)
{
return
"Parsing scene "
+
file
+
": "
+
std
::
string
(
importer
.
GetErrorString
());
return
"Parsing scene "
+
file
+
": "
+
std
::
string
(
importer
.
GetErrorString
());
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment