I have a simple python script moveobj.py

import bpy
for obj in bpy.data.objects:
    obj.location.x += 5

I want to execute this script in

class Translate_OT_Col_to_New_Location(Operator):
    bl_label = "TranslateColNewLoc"
    bl_idname = "object.translatecol"
    bl_description = "TranslateColNewLoc"

    def execute(self, context):
        execute python script moveobj.py here, is it possible?

Thanks a lot!

  • 1
    $\begingroup$ Put it into a function...? and then just run the function in the execute method. $\endgroup$
    – Jakemoyo
    Sep 30, 2022 at 12:22
  • $\begingroup$ As the python script will be updated by new content and its codes may differentiate from time to time. So I only need to execute a python script. $\endgroup$
    – Derekcbr
    Sep 30, 2022 at 12:31
  • $\begingroup$ blender.stackexchange.com/questions/51074/… Got an answer from above. $\endgroup$
    – Derekcbr
    Sep 30, 2022 at 13:15


You must log in to answer this question.

Browse other questions tagged .