I have defined an operator, which is called from a button in another operator's panel. The called operator is supposed to import a ply file into the scene.
This is the relevant code:
class LoadPointCloud_Button(bpy.types.Operator):
bl_idname = "load.pointcloud"
bl_label = "Load Point Cloud"
bl_options = {'UNDO'}
bl_description = "Load the point cloud"
def execute(self, context):
bpy.ops.import_mesh.ply(filepath="C:\\sfmoutput\\pmvs\\models\\option-0000.ply")
return{'FINISHED'}
The ply mesh is imported successfully when invoked by pressing the spacebar and typing "Load Point Cloud". When invoked from the panel button, nothing happens.
The System Console window says that the import was successful in both cases.
Successfully imported 'C:\sfmoutput\pmvs\models\option-0000.ply' in 0.554 sec
But in the latter case, nothing happens.
I tried various things including manually setting the active scene, but nothing seems to work. I couldn't find similar example code either. What's the solution to this?