Skip to content

Feature: Add Operator to Arrange Processed Meshes in a Grid #4

@Rakadeja

Description

@Rakadeja

Summary

After generating dozens or hundreds of character meshes, they all exist at the same world origin, making them difficult to view at once. A utility operator is needed to arrange all objects from the "Processed" collection into a clean, evenly-spaced grid.

This operation must only move the objects themselves, preserving each mesh's origin point at the world center (0,0,0).

Implementation Plan

  1. Create a new operator class, e.g., BF2M_OT_ArrangeGrid(bpy.types.Operator).
  2. Add a button to the UI to call this operator, perhaps appearing only after a generation is complete.
  3. The operator's execute method should:
    • Find the "Processed" collection.
    • Get the list of objects within it.
    • Define a spacing variable (e.g., 2.0 Blender units).
    • Calculate a grid width (e.g., the square root of the number of objects).
    • Loop through the objects, assigning a new object.location to each one based on its index in the loop ((index % width) * spacing, (index // width) * -spacing, 0).

This ensures only the object's location is changed, not the mesh data's relation to its origin.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions