Any2HRTF / Mesh2HRTF

Open software for the numerical calculation of head-related transfer functions
European Union Public License 1.2
111 stars 14 forks source link

bpy.ops.object.assignmaterials could not be found #110

Closed quizzy5889 closed 1 year ago

quizzy5889 commented 1 year ago

Hello everybody! First of all thank you for your amazing job. I'm running through all the examples and what you've done is really impressive.

Unfortunately, I encountered this error when trying to run the radiation_from_a_vibrating_element.py example in scripting mode. Do you have any idea? Thanks a lot

Python: Traceback (most recent call last):
  File "/radiation_from_a_vibrating_element.py", line 28, in <module>
  File "/home/head-scan/Desktop/blender-3.5.1-linux-x64/3.5/scripts/modules/bpy/ops.py", line 113, in __call__
    ret = _op_call(self.idname_py(), None, kw)
AttributeError: Calling operator "bpy.ops.object.assignmaterials" error, could not be found
f-brinkmann commented 1 year ago

Your Blender needs to know the AssignMaterials add-on. A way to permantently add the filee is described in the file here. I think another way is to call Blender with two Python scripts e.g.

Blender --background --python AssignMaterials.py --python radiation_from_a_vibrating_element.py

Make sure to use the full paths in the names of the scripts if you use the second option.

quizzy5889 commented 1 year ago

Great! Thanks a lot. That solved for me.

f-brinkmann commented 1 year ago

Good to hear - would you have some time to check, if this is mentioned in the wiki or make a suggestion where and how it should be mentioned/improved? This would help others to avoid the problem and writing good docs is somewhat hard for us because we not always see the pit falls for new people...

quizzy5889 commented 1 year ago

Yes, sure! Shall I propose a merge request?

f-brinkmann commented 1 year ago

Not sure if you can do a merge request for the wiki - in case it does not work you can put your seggestions here and I will copy them to the wiki...