0

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!

Derekcbr
  • 99
  • 1
  • 8
  • 1
    Put it into a function...? and then just run the function in the execute method. – Jakemoyo Sep 30 '22 at 12:22
  • 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. – Derekcbr Sep 30 '22 at 12:31
  • https://blender.stackexchange.com/questions/51074/how-to-run-a-python-script-external-to-blender-to-run-bpy-commands-in-blendersp Got an answer from above. – Derekcbr Sep 30 '22 at 13:15

0 Answers0