Hello all,
Thank you for this library. It has been very helpful.
I am currently using pycollada to edit .dae files produced/exported by Sketchup. I have successfully edited and saved geometry meshes in the geometries library. The pycollada documentation has a good reference on how to do this.
However, I am having trouble saving the arrays I edit which are found in the Visual Scenes library. I have attached the a snapshot of the .dae file showing the array I'd like to edit and save.
Below is the code I'm using to access and then edit and then save the array (shape is 4, 4):
import numpy as np
from collada import *
mesh_file = Collada('Turbine.dae')
HH = 80
HH_diff = HH - 65.07521057
blade_arr_1 = mesh_file.scene.nodes[0].children[2].children[1].children[0].matrix
for k in range(len(blade_arr_1)):
if k == 2:
blade_arr_1[k][3] += HH_diff
mesh_file.scene.nodes[0].children[2].children[1].children[0].matrix = blade_arr_1
mesh_file.write('turbine_mod.dae')
If I print mesh_file.scene.nodes[0].children[2].children[1].children[0].matrix, I can see the changes I made. However, when I save the file, the changes I made are not saved.
Please, help me find a solution to this. I have tried everything! Including reading the documentation cover to cover, and trying other libraries in lxml.
FYI I'm new to coding.
Best Regards,
Shatha