Open kadakadak opened 2 months ago
Text Commands window shows:
SCRIPT ERROR
Traceback (most recent call last):
File "/Users/local/Library/Application Support/Autodesk/Autodesk Fusion 360/API/Scripts/URDF_Exporter/URDF_Exporter.py", line 7, in
Perhaps the distutils copy_tree import needs to be swapped for the one in shutil?
index 10f6b1a..925b833 100644
--- a/URDF_Exporter/utils/utils.py
+++ b/URDF_Exporter/utils/utils.py
@@ -9,7 +9,7 @@ import adsk, adsk.core, adsk.fusion
import os.path, re
from xml.etree import ElementTree
from xml.dom import minidom
-from distutils.dir_util import copy_tree
+from shutil import copytree
import fileinput
import sys
@@ -149,7 +149,7 @@ def copy_package(save_dir, package_dir):
except: pass
try: os.mkdir(save_dir + '/urdf')
except: pass
- copy_tree(package_dir, save_dir)
+ copytree(package_dir, save_dir, dirs_exist_ok=True)
def update_cmakelists(save_dir, package_name):
file_name = save_dir + '/CMakeLists.txt'```
Doesn't sound like this is maintained anymore, but on the off chance someone is watching, I believe I've followed the instructions for creating a simple model to export, but when I run the script, nothing happens. No dialogs. No warnings. Not sure how to debug further. If my google translated Japanese is correct, the other person seems to be having a similar problem.
(sorry for the duplicate issue, I some how fat-fingered my return key and created an empty issue)
it seems the URDF_Exporter_ros2 fork is also not working, nothing happens it seems like the local libraries like disutils is deprecated is there any solution?
To fix the issue with the URDF_Exporter script, you'll need to update the code to replace the deprecated distutils.dir_util.copy_tree
with shutil.copytree
, which is supported in the version of Python that Fusion 360 uses.
Locate utils.py
:
utils.py
.Update the Import Statement: Find this line:
from distutils.dir_util import copy_tree
Replace it with:
from shutil import copytree
Modify the Function Calls:
Wherever copy_tree
is called, replace it with copytree
. You also need to adjust the syntax to match shutil.copytree
, which requires the dirs_exist_ok=True
argument to avoid errors when directories already exist. Find this line:
copy_tree(package_dir, save_dir)
Replace it with:
copytree(package_dir, save_dir, dirs_exist_ok=True)
Test the Changes:
Save the changes in utils.py
.
Run the script again in Fusion 360 and test to see if the dialog box for saving the URDF file now appears.
Dear, I've followed these steps but I'm now getting "SCRIPT ERROR" in the text command, and nothing pops up.
Kind regards.
Hi this still isnt working for me. nothing shows up, no dialog box
I Did the above changes for ros 1 and it worked but it's not working for ros 2
Failed: Traceback (most recent call last): File "C:/Users/admin/AppData/Roaming/Autodesk/Autodesk Fusion 360/API/Scripts/URDF_Exporter_Ros2/URDF_Exporter_Ros2.py", line 86, in run utils.create_package(package_name, save_dir, package_dir) ^^^^^^^^^^^^^^^^^^^^ AttributeError: module 'mainC%3A%2FUsers%2Fadmin%2FAppData%2FRoaming%2FAutodesk%2FAutodesk%20Fusion%20360%2FAPI%2FScripts%2FURDF_Exporter_Ros2%2FURDF_Exporter_Ros2_py.utils.utils' has no attribute 'create_package'
i am facing the above error can someone help
I Did the above changes for ros 1 and it worked but it's not working for ros 2
Failed: Traceback (most recent call last): File "C:/Users/admin/AppData/Roaming/Autodesk/Autodesk Fusion 360/API/Scripts/URDF_Exporter_Ros2/URDF_Exporter_Ros2.py", line 86, in run utils.create_package(package_name, save_dir, package_dir) ^^^^^^^^^^^^^^^^^^^^ AttributeError: module 'mainC%3A%2FUsers%2Fadmin%2FAppData%2FRoaming%2FAutodesk%2FAutodesk%20Fusion%20360%2FAPI%2FScripts%2FURDF_Exporter_Ros2%2FURDF_Exporter_Ros2_py.utils.utils' has no attribute 'create_package'
i am facing the above error can someone help
to fix this error you just have to simply check your design to crosscheck design delete errors
Doesn't sound like this is maintained anymore, but on the off chance someone is watching, I believe I've followed the instructions for creating a simple model to export, but when I run the script, nothing happens. No dialogs. No warnings. Not sure how to debug further. If my google translated Japanese is correct, the other person seems to be having a similar problem.
(sorry for the duplicate issue, I some how fat-fingered my return key and created an empty issue)