Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
blender-addons
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
Container Registry
Model registry
Operate
Environments
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
blender
blender-addons
Commits
d405965c
Commit
d405965c
authored
11 years ago
by
Campbell Barton
Browse files
Options
Downloads
Patches
Plain Diff
worarounds to get some models for 3dsmax loading
parent
024f12e5
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
io_scene_fbx/import_fbx.py
+20
-3
20 additions, 3 deletions
io_scene_fbx/import_fbx.py
with
20 additions
and
3 deletions
io_scene_fbx/import_fbx.py
+
20
−
3
View file @
d405965c
...
...
@@ -377,7 +377,7 @@ def blen_read_geom_array_mapped_polygon(
):
if
fbx_layer_mapping
==
b
'
ByPolygon
'
:
if
fbx_layer_ref
in
{
b
'
IndexToDirect
'
,
b
'
Direct
'
}
:
if
fbx_layer_ref
==
b
'
IndexToDirect
'
:
if
stride
==
1
:
for
i
,
blen_data_item
in
enumerate
(
blen_data
):
setattr
(
blen_data_item
,
blend_attr
,
fbx_layer_data
[
i
])
...
...
@@ -385,6 +385,12 @@ def blen_read_geom_array_mapped_polygon(
for
i
,
blen_data_item
in
enumerate
(
blen_data
):
setattr
(
blen_data_item
,
blend_attr
,
fbx_layer_data
[(
i
*
stride
):
(
i
*
stride
)
+
stride
])
return
True
elif
fbx_layer_ref
==
b
'
Direct
'
:
# looks like direct may have different meanings!
assert
(
stride
==
1
)
for
i
in
fbx_layer_data
:
setattr
(
blen_data
[
i
-
1
],
blend_attr
,
True
)
return
True
else
:
print
(
"
warning layer %r ref type unsupported: %r
"
%
(
descr
,
fbx_layer_ref
))
else
:
...
...
@@ -492,6 +498,10 @@ def blen_read_geom_layer_smooth(fbx_obj, mesh):
return
False
if
fbx_layer_mapping
==
b
'
ByEdge
'
:
# some models have bad edge data, we cant use this info...
if
not
mesh
.
edges
:
return
False
blen_data
=
mesh
.
edges
ok_smooth
=
blen_read_geom_array_mapped_edge
(
mesh
,
blen_data
,
"
use_edge_sharp
"
,
...
...
@@ -582,8 +592,15 @@ def blen_read_geom(fbx_tmpl, fbx_obj):
blen_read_geom_layer_uv
(
fbx_obj
,
mesh
)
if
fbx_edges
:
mesh
.
edges
.
add
(
len
(
fbx_edges
)
//
2
)
mesh
.
edges
.
foreach_set
(
"
vertices
"
,
fbx_edges
)
# workaround for odd number of edge vertices
tot_edges
=
len
(
fbx_edges
)
//
2
if
len
(
fbx_edges
)
%
2
:
print
(
"
Corrupt edges found in: %s
"
%
elem_name_utf8
)
else
:
mesh
.
edges
.
add
(
tot_edges
)
mesh
.
edges
.
foreach_set
(
"
vertices
"
,
fbx_edges
)
# must be after edge, face loading.
ok_smooth
=
blen_read_geom_layer_smooth
(
fbx_obj
,
mesh
)
...
...
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