Blender_bevy_components_wor.../tools/blenvy/bevy_components/helpers.py
kaosat.dev b8a7eba71d feat(blenvy):
* improvements to assets ui
 * assets ui now specific to per level data, not based on selection anymore
 * blueprints ui now presents assets per blueprint
 * a lot of tweaks & improvements in the areas above
2024-05-13 23:36:13 +02:00

20 lines
681 B
Python

import bpy
import json
# Makes an empty, at the specified location, rotation, scale stores it in existing collection, from https://blender.stackexchange.com/questions/51290/how-to-add-empty-object-not-using-bpy-ops
def make_empty(name, location, rotation, scale, collection):
object_data = None
empty_obj = bpy.data.objects.new( name, object_data )
empty_obj.empty_display_size = 2
empty_obj.empty_display_type = 'PLAIN_AXES'
empty_obj.name = name
empty_obj.location = location
empty_obj.scale = scale
empty_obj.rotation_euler = rotation
collection.objects.link( empty_obj )
#bpy.context.view_layer.update()
return empty_obj