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
79d1a85d
Commit
79d1a85d
authored
12 years ago
by
Campbell Barton
Browse files
Options
Downloads
Patches
Plain Diff
fix [#34606] x3d file with comma separated coordinates doesn't import
parent
93be8553
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
io_scene_x3d/import_x3d.py
+7
-13
7 additions, 13 deletions
io_scene_x3d/import_x3d.py
with
7 additions
and
13 deletions
io_scene_x3d/import_x3d.py
+
7
−
13
View file @
79d1a85d
...
@@ -532,7 +532,7 @@ class vrmlNode(object):
...
@@ -532,7 +532,7 @@ class vrmlNode(object):
child
.
searchNodeTypeID
(
node_spec
,
results
)
child
.
searchNodeTypeID
(
node_spec
,
results
)
return
results
return
results
def
getFieldName
(
self
,
field
,
ancestry
,
AS_CHILD
=
False
):
def
getFieldName
(
self
,
field
,
ancestry
,
AS_CHILD
=
False
,
SPLIT_COMMAS
=
False
):
self_real
=
self
.
getRealNode
()
# in case we're an instance
self_real
=
self
.
getRealNode
()
# in case we're an instance
for
f
in
self_real
.
fields
:
for
f
in
self_real
.
fields
:
...
@@ -739,7 +739,7 @@ class vrmlNode(object):
...
@@ -739,7 +739,7 @@ class vrmlNode(object):
self_real
=
self
.
getRealNode
()
# in case we're an instance
self_real
=
self
.
getRealNode
()
# in case we're an instance
child_array
=
self_real
.
getFieldName
(
field
,
ancestry
,
True
)
child_array
=
self_real
.
getFieldName
(
field
,
ancestry
,
True
,
SPLIT_COMMAS
=
True
)
#if type(child_array)==list: # happens occasionaly
#if type(child_array)==list: # happens occasionaly
# array_data = child_array
# array_data = child_array
...
@@ -747,23 +747,15 @@ class vrmlNode(object):
...
@@ -747,23 +747,15 @@ class vrmlNode(object):
if
child_array
is
None
:
if
child_array
is
None
:
# For x3d, should work ok with vrml too
# For x3d, should work ok with vrml too
# for x3d arrays are fields, vrml they are nodes, annoying but not tooo bad.
# for x3d arrays are fields, vrml they are nodes, annoying but not tooo bad.
data_split
=
self
.
getFieldName
(
field
,
ancestry
)
data_split
=
self
.
getFieldName
(
field
,
ancestry
,
SPLIT_COMMAS
=
True
)
if
not
data_split
:
if
not
data_split
:
return
[]
return
[]
array_data
=
'
'
.
join
(
data_split
)
if
array_data
is
None
:
return
[]
array_data
=
array_data
.
replace
(
'
,
'
,
'
'
)
data_split
=
array_data
.
split
()
array_data
=
array_as_number
(
data_split
)
array_data
=
array_as_number
(
data_split
)
elif
type
(
child_array
)
==
list
:
elif
type
(
child_array
)
==
list
:
# x3d creates these
# x3d creates these
data_split
=
[
w
.
strip
(
"
,
"
)
for
w
in
child_array
]
array_data
=
array_as_number
(
child_array
)
array_data
=
array_as_number
(
data_split
)
else
:
else
:
# print(child_array)
# print(child_array)
# Normal vrml
# Normal vrml
...
@@ -1344,7 +1336,7 @@ class x3dNode(vrmlNode):
...
@@ -1344,7 +1336,7 @@ class x3dNode(vrmlNode):
# Other funcs operate from vrml, but this means we can wrap XML fields, still use nice utility funcs
# Other funcs operate from vrml, but this means we can wrap XML fields, still use nice utility funcs
# getFieldAsArray getFieldAsBool etc
# getFieldAsArray getFieldAsBool etc
def
getFieldName
(
self
,
field
,
ancestry
,
AS_CHILD
=
False
):
def
getFieldName
(
self
,
field
,
ancestry
,
AS_CHILD
=
False
,
SPLIT_COMMAS
=
False
):
# ancestry and AS_CHILD are ignored, only used for VRML now
# ancestry and AS_CHILD are ignored, only used for VRML now
self_real
=
self
.
getRealNode
()
# in case we're an instance
self_real
=
self
.
getRealNode
()
# in case we're an instance
...
@@ -1354,6 +1346,8 @@ class x3dNode(vrmlNode):
...
@@ -1354,6 +1346,8 @@ class x3dNode(vrmlNode):
# We may want to edit. for x3d specific stuff
# We may want to edit. for x3d specific stuff
# Sucks a bit to return the field name in the list but vrml excepts this :/
# Sucks a bit to return the field name in the list but vrml excepts this :/
if
SPLIT_COMMAS
:
value
=
value
.
replace
(
"
,
"
,
"
"
)
return
value
.
split
()
return
value
.
split
()
else
:
else
:
return
None
return
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