0

I'm trying to make a scene from a game and the map is divided into chunks as per usual. But the problem is when i want to import the map i have to import each chunk individually and then move it manually 32 units on the y axis so they form the map. But this would take many many hours to do because the map has over 1000 chunks. It think it's probably possible with some sort of script but i'm a beginner with scripting and haven't found a way to do so.

Ake
  • 3
  • 1

1 Answers1

1

batFINGER shows how to load objects from a .blend file here.

To move the objects, you could use

selected_objects = [obj for obj in bpy.data.objects if obj.select]
for i, obj in enumerate(selected_objects):
    obj.location[1] = 32*i

This moves the selected objects so that their y-coordinates are 32 units apart. Essentially this idea and a number of other examples are showcased on the Blender Developers Blog here.

unutbu
  • 350
  • 3
  • 11
  • I think i wrote a bit wrong what i mean that i need to translate each chunk so they are 32 units apart like in the array modifier. – Ake Dec 31 '18 at 15:09
  • Ah, that makes more sense. I've modified the code to space the objects 32 units apart. – unutbu Dec 31 '18 at 15:20