qinglew / PCN-PyTorch

Implementation of PCN(Point Completion Network) in PyTorch.
141 stars 33 forks source link

Error while running render_depth.py #27

Closed WiktorLigeza closed 1 year ago

WiktorLigeza commented 1 year ago

Hi,

These are the logs from the blender.log file:

Progress:   0.00%
(  0.0001 sec |   0.0001 sec) Importing OBJ 'models/0/model.obj'...
Progress:   0.00%
  (  0.0001 sec |   0.0000 sec) Parsing OBJ file...
Progress:   0.00%
    (  0.0002 sec |   0.0001 sec) Done, loading materials and images...
Progress:  33.33%
    (  0.0052 sec |   0.0051 sec) Done, building geometries (verts:8 faces:6 materials: 1 smoothgroups:0) ...
Progress:  66.67%
    (  0.0060 sec |   0.0059 sec) Done.
Progress:  66.67%
Progress: 100.00%
  (  0.0061 sec |   0.0060 sec) Finished importing: 'models/0/model.obj'
Progress: 100.00%
Progress: 100.00%

Model imported successfully!
Error: File format is not supported in file '/home/Fun/3D_reconstruction/PCN-PyTorch-master/render/models'

Blender quit

this is the terminal input blender -b -P render_depth.py "models" "models/list.txt" "output" 25

and this is the output from the terminal: Color management: using fallback mode for management Color management: Error could not find role data role. Blender 3.0.1 Read prefs: /home/wiktor/.config/blender/3.0/config/userpref.blend Color management: scene view "Filmic" not found, setting default "Standard". 0 Traceback (most recent call last): File "/home/Fun/3D_reconstruction/PCN-PyTorch-master/render/render_depth.py", line 128, in <module> bpy.ops.transform.rotate(value=-np.pi / 2, axis=(1, 0, 0)) File "/usr/share/blender/scripts/modules/bpy/ops.py", line 132, in __call__ ret = _op_call(self.idname_py(), None, kw) RuntimeError: Operator bpy.ops.transform.rotate.poll() failed, context is incorrect

I have even added this piece of code to check if the obj file was loaded properly, and it turns out it was indeed:

        # Get a list of all the imported objects in the scene
        imported_objects = [obj for obj in bpy.context.scene.objects if obj.type == 'MESH']

        # Verify that at least one object was imported
        if len(imported_objects) > 0:
            print("Model imported successfully!")
        else:
            print("Error: Model was not imported.")

I was debugging it and found that this line is causing the error: bpy.ops.transform.rotate(value=-np.pi/2, axis=(1, 0, 0)).

What I don't understand is why Blender is referring to the 'models' folder. The error message states: 'Error: File format is not supported in file '/home/Fun/3D_reconstruction/PCN-PyTorch-master/render/models'.

I don't see anything in the code that could cause this error :/

File structure: image

WiktorLigeza commented 1 year ago

Changing blender version to 2.7.9 solved the problem.