Problem in PyQt with blender

Hello,
I create an interface with PyQt5 Inside Blender. i embed into this interface some buttons to run my script.
My project is import a file .stl with a button from my hard drive and it works well.

self.import_btn.clicked.connect(self.importCommand)
def importCommand(self, context): 
        qfd = QFileDialog()
        title = 'Open STL file'
        path = "C:/"
        f = QFileDialog.getOpenFileName(qfd, title, path, '*.stl')
        bpy.ops.import_mesh.stl(filepath=f[0])
        Remake()
def Remake(self,context):
    main = bpy.data.objects['Main']
    main.select=True
    bpy.context.scene.objects.active= main
    bpy.ops.transform.resize(value=(1+pourcentageaugmentation, 1+pourcentageaugmentation, 1+pourcentageaugmentation), constraint_axis=(False, False, False), constraint_orientation='GLOBAL', mirror=False, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=1)
    return {'FINISHED'}

But when i add a function to remake this stl file, The blender and my interface PyQt crashe:


My problem is in this function bpy.ops.transform.resize
Can you help me please?

is there any reply…

What is the console output? (If you start blender from a console, there might be some error messages after crashing.)

You can also read answers…

Your Blender is probably not crashing but wait that the Qt window finish.

I don’t found the solution yet. can you help me with a tutorial or an example please?

In the console, i have this error:
AttributeError: ‘bool’ object has no attribute ‘scene’

In the console, i have this error:
AttributeError: ‘bool’ object has no attribute ‘scene’
this is my function:
def mark1Command(self, context):
bpy.ops.object.empty_add(type=‘PLAIN_AXES’, radius=1, view_align=False, location=(context.scene.cursor_location.x,context.scene.cursor_location.y,context.scene.cursor_location.z), layers=(True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False))
for obj in bpy.context.selected_objects:
obj.name = “Repere1”
return {‘FINISHED’}

def mark1Command(self, context):

If the error is in this function, probably you are calling it with a wrong “context” argument. You are a sending a “bool”. But it needs to be a bpy.context object.

quand je mis: def mark1Command(self, bpy.context):
ça me donne une erreur (invalid syntax)

avant d’implémenter PyQt, j’ai utilisé GUI de Blender et ça marche bien.
Je veux maintenant le transformer en PyQt5. voila le code d’avant:
class Repere1(bpy.types.Operator):
bl_idname=“object.repere1”
bl_label = " Creation Repere 1 "
def execute(self,context):
bpy.ops.object.empty_add(type=‘PLAIN_AXES’, radius=1, view_align=False, location=(context.scene.cursor_location.x,context.scene.cursor_location.y,context.scene.cursor_location.z), layers=(True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False))
for obj in bpy.context.selected_objects:
obj.name = “Repere1”
return {‘FINISHED’}
bpy.utils.register_class(Repere1)

before i code with PyQt, i used GUI of Blender and it works very well.
I want to convert GUI blender to PyQt5. this is my code:
class Repere1(bpy.types.Operator):
bl_idname=“object.repere1”
bl_label = " Creation Repere 1 "
def execute(self,context):
bpy.ops.object.empty_add(type=‘PLAIN_AXES’, radius=1, view_align=False, location=(context.scene.cursor_location.x,context. scene.cursor_location.y,context.scene.cursor_locat ion.z), layers=(True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False))
for obj in bpy.context.selected_objects:
obj.name = “Repere1”
return {‘FINISHED’}
bpy.utils.register_class(Repere1)