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
b99cd4de
Commit
b99cd4de
authored
14 years ago
by
Campbell Barton
Browse files
Options
Downloads
Patches
Plain Diff
fix for exception exporting empty curves. added use_selected option for the operator.
parent
251e10b5
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
io_scene_x3d/__init__.py
+1
-0
1 addition, 0 deletions
io_scene_x3d/__init__.py
io_scene_x3d/export_x3d.py
+22
-10
22 additions, 10 deletions
io_scene_x3d/export_x3d.py
with
23 additions
and
10 deletions
io_scene_x3d/__init__.py
+
1
−
0
View file @
b99cd4de
...
...
@@ -63,6 +63,7 @@ class ExportX3D(bpy.types.Operator, ExportHelper):
filename_ext
=
"
.x3d
"
filter_glob
=
StringProperty
(
default
=
"
*.x3d
"
,
options
=
{
'
HIDDEN
'
})
use_selection
=
BoolProperty
(
name
=
"
Selection Only
"
,
description
=
"
Export selected objects only
"
,
default
=
False
)
use_apply_modifiers
=
BoolProperty
(
name
=
"
Apply Modifiers
"
,
description
=
"
Use transformed mesh data from each object
"
,
default
=
True
)
use_triangulate
=
BoolProperty
(
name
=
"
Triangulate
"
,
description
=
"
Triangulate quads.
"
,
default
=
False
)
use_compress
=
BoolProperty
(
name
=
"
Compress
"
,
description
=
"
GZip the resulting file, requires a full python install
"
,
default
=
False
)
...
...
This diff is collapsed.
Click to expand it.
io_scene_x3d/export_x3d.py
+
22
−
10
View file @
b99cd4de
...
...
@@ -680,7 +680,8 @@ class x3d_class:
##########################################################
def
export
(
self
,
scene
,
world
,
alltextures
,
EXPORT_APPLY_MODIFIERS
=
False
,
use_apply_modifiers
=
False
,
use_selection
=
True
,
EXPORT_TRI
=
False
,
):
...
...
@@ -697,7 +698,12 @@ class x3d_class:
self
.
writeFog
(
world
)
self
.
proto
=
0
for
ob_main
in
[
o
for
o
in
scene
.
objects
if
o
.
is_visible
(
scene
)]:
if
use_selection
:
objects
=
(
o
for
o
in
scene
.
objects
if
o
.
is_visible
(
scene
)
and
o
.
select
)
else
:
objects
=
(
o
for
o
in
scene
.
objects
if
o
.
is_visible
(
scene
))
for
ob_main
in
objects
:
free
,
derived
=
create_derived_objects
(
scene
,
ob_main
)
...
...
@@ -712,16 +718,20 @@ class x3d_class:
if
objType
==
'
CAMERA
'
:
self
.
writeViewpoint
(
ob
,
ob_mat
,
scene
)
elif
objType
in
(
'
MESH
'
,
'
CURVE
'
,
'
SURF
'
,
'
FONT
'
):
if
EXPORT_APPLY_MODIFIERS
or
objType
!=
'
MESH
'
:
me
=
ob
.
create_mesh
(
scene
,
EXPORT_APPLY_MODIFIERS
,
'
PREVIEW
'
)
if
use_apply_modifiers
or
objType
!=
'
MESH
'
:
try
:
me
=
ob
.
create_mesh
(
scene
,
use_apply_modifiers
,
'
PREVIEW
'
)
except
:
me
=
None
else
:
me
=
ob
.
data
self
.
writeIndexedFaceSet
(
ob
,
me
,
ob_mat
,
world
,
EXPORT_TRI
=
EXPORT_TRI
)
if
me
is
not
None
:
self
.
writeIndexedFaceSet
(
ob
,
me
,
ob_mat
,
world
,
EXPORT_TRI
=
EXPORT_TRI
)
# free mesh created with create_mesh()
if
me
!=
ob
.
data
:
bpy
.
data
.
meshes
.
remove
(
me
)
# free mesh created with create_mesh()
if
me
!=
ob
.
data
:
bpy
.
data
.
meshes
.
remove
(
me
)
elif
objType
==
'
LAMP
'
:
data
=
ob
.
data
...
...
@@ -743,7 +753,7 @@ class x3d_class:
self
.
file
.
write
(
"
\n
</Scene>
\n
</X3D>
"
)
# if
EXPORT_APPLY_MODIFIERS
:
# if
use_apply_modifiers
:
# if containerMesh:
# containerMesh.vertices = None
...
...
@@ -827,6 +837,7 @@ class x3d_class:
def
save
(
operator
,
context
,
filepath
=
""
,
use_selection
=
True
,
use_apply_modifiers
=
False
,
use_triangulate
=
False
,
use_compress
=
False
):
...
...
@@ -852,7 +863,8 @@ def save(operator, context, filepath="",
wrlexport
.
export
(
scene
,
world
,
alltextures
,
EXPORT_APPLY_MODIFIERS
=
use_apply_modifiers
,
use_apply_modifiers
=
use_apply_modifiers
,
use_selection
=
use_selection
,
EXPORT_TRI
=
use_triangulate
,
)
...
...
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