mirror of
https://github.com/kaosat-dev/Blender_bevy_components_workflow.git
synced 2024-11-23 04:10:53 +00:00
dc7422fe7a
* this is in preparation for future support in bevy & for more coherence & practicality * overhauled metadata tooling * overhauled most of the operators * overhauled most of the UI * all the basics & more work ! * unrelated: also started preping for auto_export operator removal
18 lines
532 B
Python
18 lines
532 B
Python
import bpy
|
|
|
|
#FIXME: does not work if object is hidden !!
|
|
def get_selected_object_or_collection(context):
|
|
target = None
|
|
object = next(iter(context.selected_objects), None)
|
|
collection = context.collection
|
|
if object is not None:
|
|
target = object
|
|
elif collection is not None:
|
|
target = collection
|
|
return target
|
|
|
|
def get_selection_type(selection):
|
|
if isinstance(selection, bpy.types.Object):
|
|
return 'Object'
|
|
if isinstance(selection, bpy.types.Collection):
|
|
return 'Collection' |