diff --git a/pdm.lock b/pdm.lock index 99dc10f..6e544c5 100644 --- a/pdm.lock +++ b/pdm.lock @@ -5,7 +5,7 @@ groups = ["default", "test"] strategy = ["inherit_metadata"] lock_version = "4.5.0" -content_hash = "sha256:27a4efee379c00c25750a5a1e1d93d80bd6b6111ff7cf0820cd4a5b52fc7c1ee" +content_hash = "sha256:78b8e57425bb7534d54468af85c73d5e034cbad1544b25d65a59bc622565cd9a" [[metadata.targets]] requires_python = ">=3.9" diff --git a/pyproject.toml b/pyproject.toml index 1b81c5b..5af1400 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ dependencies = [ "numpy>=1.14", "OWSLib", "Pillow", - "pycollada", + "pycollada>=0.8", "pyproj", "SQLAlchemy", "diskcache", @@ -32,5 +32,3 @@ test = [ requires = ["pdm-backend"] build-backend = "pdm.backend" -[tool.pdm] - diff --git a/scripts/lib/exports/collada_kit.py b/scripts/lib/exports/collada_kit.py index 0ad97f3..0325dd4 100755 --- a/scripts/lib/exports/collada_kit.py +++ b/scripts/lib/exports/collada_kit.py @@ -129,6 +129,7 @@ def add_geom_to_collada(self, geom_obj, style_obj, meta_obj): self.mesh_obj.geometries.append(geom) self.geomnode_list.append(Collada.scene.GeometryNode(geom, [matnode])) + # Create metadata for popup window on map popup_dict[geometry_name] = {'title': meta_obj.name, 'name': meta_obj.name} node_label = geometry_name @@ -151,6 +152,7 @@ def add_geom_to_collada(self, geom_obj, style_obj, meta_obj): self.geomnode_list, geom_obj.seg_arr, geom_obj.vrtx_arr, self.obj_cnt, geom_obj.line_width, not geom_obj.is_vert_line) + # Create metadata for popup window on map for geom_label in geom_label_list: popup_dict[geom_label] = {'title': meta_obj.name, 'name': meta_obj.name} node_label = geom_label @@ -183,6 +185,7 @@ def add_geom_to_collada(self, geom_obj, style_obj, meta_obj): self.geomnode_list, vrtx, self.obj_cnt, self.POINT_SIZE, colour_num) + # Create metadata for popup window on map popup_dict[geom_label] = {'name': meta_obj.get_property_name(), 'title': geometry_name.replace('_', ' ')} # Some vertices do not have properties diff --git a/scripts/lib/exports/collada_out.py b/scripts/lib/exports/collada_out.py index 1f52acb..db502de 100644 --- a/scripts/lib/exports/collada_out.py +++ b/scripts/lib/exports/collada_out.py @@ -124,8 +124,6 @@ def make_line(self, mesh, geometry_name, geomnode_list, seg_arr, vrtx_arr, obj_c :param z_expand: is true if line width is drawn in z-direction else x-direction :returns: the line's geometry label ''' - matnode = Collada.scene.MaterialNode("materialref-{0:05d}".format(obj_cnt), - mesh.materials[-1], inputs=[]) geom_label_list = [] for point_cnt, vert_floats, indices in line_gen(seg_arr, vrtx_arr, line_width, z_expand): @@ -142,6 +140,8 @@ def make_line(self, mesh, geometry_name, geomnode_list, seg_arr, vrtx_arr, obj_c input_list.addInput(0, 'VERTEX', "#lineverts-array-{0:010d}-{1:05d}".format(point_cnt, obj_cnt)) + matnode = Collada.scene.MaterialNode("materialref-{0:010d}-{0:05d}".format(point_cnt, obj_cnt), + mesh.materials[-1], inputs=[]) triset = geom.createTriangleSet(numpy.array(indices), input_list, "materialref-{0:05d}".format(obj_cnt)) geom.primitives.append(triset)