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
b113287a
Commit
b113287a
authored
12 years ago
by
Campbell Barton
Browse files
Options
Downloads
Patches
Plain Diff
VRML: export vertex colors by default and fallback to material colors.
parent
0fee27b5
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
io_scene_vrml2/__init__.py
+2
-3
2 additions, 3 deletions
io_scene_vrml2/__init__.py
io_scene_vrml2/export_vrml2.py
+4
-4
4 additions, 4 deletions
io_scene_vrml2/export_vrml2.py
with
6 additions
and
7 deletions
io_scene_vrml2/__init__.py
+
2
−
3
View file @
b113287a
...
@@ -70,9 +70,8 @@ class ExportVRML(bpy.types.Operator, ExportHelper):
...
@@ -70,9 +70,8 @@ class ExportVRML(bpy.types.Operator, ExportHelper):
color_type
=
EnumProperty
(
color_type
=
EnumProperty
(
name
=
'
Color
'
,
name
=
'
Color
'
,
items
=
(
items
=
(
(
'
MATERIAL
'
,
"
Material Color
"
,
""
),
(
'
VERTEX
'
,
"
Vertex Color
"
,
""
),
(
'
VERTEX
'
,
"
Vertex Color
"
,
""
)),
(
'
MATERIAL
'
,
"
Material Color
"
,
""
)),
default
=
'
MATERIAL
'
,
)
)
use_uv
=
BoolProperty
(
use_uv
=
BoolProperty
(
name
=
"
Texture/UVs
"
,
name
=
"
Texture/UVs
"
,
...
...
This diff is collapsed.
Click to expand it.
io_scene_vrml2/export_vrml2.py
+
4
−
4
View file @
b113287a
...
@@ -206,16 +206,16 @@ def save_object(fw, global_matrix,
...
@@ -206,16 +206,16 @@ def save_object(fw, global_matrix,
if
use_color
:
if
use_color
:
if
color_type
==
'
VERTEX
'
:
if
color_type
==
'
VERTEX
'
:
if
bm
.
loops
.
layers
.
color
.
active
is
None
:
if
bm
.
loops
.
layers
.
color
.
active
is
None
:
use_color
=
False
# fallback to material
elif
color_type
==
'
MATERIAL
'
:
color_type
=
'
MATERIAL
'
if
color_type
==
'
MATERIAL
'
:
if
not
me
.
materials
:
if
not
me
.
materials
:
use_color
=
False
use_color
=
False
else
:
else
:
material_colors
=
[
material_colors
=
[
"
%.2f %.2f %.2f
"
%
(
m
.
diffuse_color
[:]
if
m
else
(
1.0
,
1.0
,
1.0
))
"
%.2f %.2f %.2f
"
%
(
m
.
diffuse_color
[:]
if
m
else
(
1.0
,
1.0
,
1.0
))
for
m
in
me
.
materials
]
for
m
in
me
.
materials
]
else
:
assert
(
color_type
in
{
'
VERTEX
'
,
'
MATERIAL
'
})
assert
(
0
)
if
use_uv
:
if
use_uv
:
if
bm
.
loops
.
layers
.
uv
.
active
is
None
:
if
bm
.
loops
.
layers
.
uv
.
active
is
None
:
...
...
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