[Bf-extensions-cvs] [22602da] master: X3D: Don't write line-no into objects by default
Campbell Barton
noreply at git.blender.org
Sat Oct 24 06:02:26 CEST 2015
Commit: 22602daa3df7fc4ee18d80475269dc3e9d1b082b
Author: Campbell Barton
Date: Sat Oct 24 14:49:09 2015 +1100
Branches: master
https://developer.blender.org/rBA22602daa3df7fc4ee18d80475269dc3e9d1b082b
X3D: Don't write line-no into objects by default
This is handy for debugging, not general use.
so only do this when DEBUG is set.
Also use a custom property instead of registering RNA.
===================================================================
M io_scene_x3d/import_x3d.py
===================================================================
diff --git a/io_scene_x3d/import_x3d.py b/io_scene_x3d/import_x3d.py
index 2af0088..c67eba9 100644
--- a/io_scene_x3d/import_x3d.py
+++ b/io_scene_x3d/import_x3d.py
@@ -3024,10 +3024,12 @@ def importShape_ProcessObject(vrmlname, bpydata, geom, geom_spec, node,
# the data
# bpymesh.transform(getFinalMatrix(node))
bpyob = node.blendObject = bpy.data.objects.new(vrmlname, bpydata)
- bpyob.source_line_no = geom.lineno
bpyob.matrix_world = getFinalMatrix(node, None, ancestry, global_matrix)
bpy.context.scene.objects.link(bpyob).select = True
+ if DEBUG:
+ bpyob["source_line_no"] = geom.lineno
+
def importText(geom, ancestry, bpyima):
fmt = geom.getChildBySpec('FontStyle')
@@ -3454,12 +3456,6 @@ def load_web3d(path,
# Used when adding blender primitives
GLOBALS['CIRCLE_DETAIL'] = PREF_CIRCLE_DIV
- # Enable custom property for source line number
- if not hasattr(bpy.types.Object, "source_line_no"):
- bpy.types.Object.source_line_no = bpy.props.IntProperty(
- name="Source Line #",
- description="Node position in the source X3D/VRML file")
-
#root_node = vrml_parse('/_Cylinder.wrl')
if path.lower().endswith('.x3d'):
root_node, msg = x3d_parse(path)
More information about the Bf-extensions-cvs
mailing list