generated from stilobique/BlenderTemplate
Compare commits
3 Commits
940bc14d77
...
a9564255da
| Author | SHA1 | Date | |
|---|---|---|---|
| a9564255da | |||
| 0821574902 | |||
| 4fa3170b93 |
-15
@@ -7,24 +7,9 @@
|
|||||||
__pycache__/
|
__pycache__/
|
||||||
**/__pycache__/
|
**/__pycache__/
|
||||||
|
|
||||||
|
|
||||||
# Unit Test #
|
|
||||||
*.zip
|
|
||||||
tests/blender/**
|
|
||||||
tests/blender/*.dmg
|
|
||||||
!tests/blender/.keep
|
|
||||||
|
|
||||||
### Blender ###
|
### Blender ###
|
||||||
*.blend1
|
*.blend1
|
||||||
|
|
||||||
### Unreal ###
|
|
||||||
tests/unreal_sample/DerivedDataCache
|
|
||||||
tests/unreal_sample/Intermediate
|
|
||||||
tests/unreal_sample/Saved
|
|
||||||
|
|
||||||
# Secret file
|
|
||||||
**/token.txt
|
|
||||||
|
|
||||||
# Virtual Environment
|
# Virtual Environment
|
||||||
**/venv/**
|
**/venv/**
|
||||||
venv/
|
venv/
|
||||||
@@ -17,6 +17,7 @@ Requiert your blend file are write on your hard-drive."""
|
|||||||
self.category = self.get_asset_type()
|
self.category = self.get_asset_type()
|
||||||
|
|
||||||
self.instance_type_dict = {}
|
self.instance_type_dict = {}
|
||||||
|
self.temp_copy = {}
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
@@ -48,7 +49,7 @@ Requiert your blend file are write on your hard-drive."""
|
|||||||
for ob in child.all_objects:
|
for ob in child.all_objects:
|
||||||
print(f'\tLook "{ob.name}", his type are "{type(ob.data)}"')
|
print(f'\tLook "{ob.name}", his type are "{type(ob.data)}"')
|
||||||
# TODO Support another type object, not only SM/SK
|
# TODO Support another type object, not only SM/SK
|
||||||
if ob.type == 'MESH' or 'EMPTY':
|
if ob.type == 'MESH' or 'EMPTY' or 'CURVE':
|
||||||
print(f'[Pipeline] Check ob {ob.name} and is type {type(ob)}')
|
print(f'[Pipeline] Check ob {ob.name} and is type {type(ob)}')
|
||||||
ob.select_set(True)
|
ob.select_set(True)
|
||||||
|
|
||||||
@@ -57,6 +58,10 @@ Requiert your blend file are write on your hard-drive."""
|
|||||||
self.instance_type_dict[ob.name] = ob.instance_type
|
self.instance_type_dict[ob.name] = ob.instance_type
|
||||||
ob.instance_type = 'NONE'
|
ob.instance_type = 'NONE'
|
||||||
|
|
||||||
|
if ob.type == 'CURVE':
|
||||||
|
# Make a new objet with the Geo
|
||||||
|
bpy.ops.object.convert(target='CURVE')
|
||||||
|
|
||||||
abs_export = self.category.joinpath(self.asset, "Meshes")
|
abs_export = self.category.joinpath(self.asset, "Meshes")
|
||||||
if not abs_export.exists():
|
if not abs_export.exists():
|
||||||
abs_export.mkdir(parents=True)
|
abs_export.mkdir(parents=True)
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
import bpy
|
import bpy
|
||||||
|
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
|
||||||
class ConfigLighting(bpy.types.Operator):
|
class ConfigLighting(bpy.types.Operator):
|
||||||
"""Add or conform a lighting build"""
|
"""Add or conform a lighting build"""
|
||||||
@@ -7,6 +9,44 @@ class ConfigLighting(bpy.types.Operator):
|
|||||||
bl_label = 'Config or update a lighting'
|
bl_label = 'Config or update a lighting'
|
||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
print(f'[Pipeline] Start lighting operator')
|
# Look if a light object are in the scene to clear
|
||||||
|
self.clear_light_on_scene()
|
||||||
|
|
||||||
|
r = self.get_blend_resources_file()
|
||||||
|
print(f'[Pipeline] Get file resource {r}')
|
||||||
|
|
||||||
return {'FINISHED'}
|
return {'FINISHED'}
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def get_blend_resources_file():
|
||||||
|
"""Get the blend file shared with the addon"""
|
||||||
|
addon_folder = Path(bpy.utils.user_resource('SCRIPTS'))
|
||||||
|
print(f'[Pipeline] Get addon folder "{addon_folder}"')
|
||||||
|
addon_name = str(bpy.context.preferences.addons[__name__.split(".")[0]])
|
||||||
|
print(f'[Pipeline] The addon name "{addon_name}"')
|
||||||
|
|
||||||
|
return addon_folder.joinpath("addons", addon_name, "resources").as_posix()
|
||||||
|
|
||||||
|
def get_world(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def get_light_collection(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def clear_light_on_scene(self):
|
||||||
|
bpy.ops.object.select_all(action='DESELECT')
|
||||||
|
|
||||||
|
for ob in bpy.data.objects:
|
||||||
|
if ob.type == 'LIGHT' and self.find_collection(ob):
|
||||||
|
ob.select_set(True)
|
||||||
|
bpy.ops.object.delete()
|
||||||
|
|
||||||
|
else:
|
||||||
|
ob.select_set(False)
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def find_collection(ob, name='Lighting'):
|
||||||
|
"""Check if an object are attached with the Lighting collection"""
|
||||||
|
for collection in ob.users_collection:
|
||||||
|
if collection.name == name:
|
||||||
|
return True
|
||||||
|
|||||||
@@ -11,4 +11,5 @@ class MakeBasicCollision(bpy.types.Operator):
|
|||||||
return bpy.context.object
|
return bpy.context.object
|
||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
|
# TODO
|
||||||
return {'FINISHED'}
|
return {'FINISHED'}
|
||||||
|
|||||||
@@ -86,5 +86,7 @@ class SetCollectionSocket(bpy.types.Operator):
|
|||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.socket = bpy.data.collections.get('Socket')
|
self.socket = bpy.data.collections.get('Socket')
|
||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
|
# TODO
|
||||||
return {'FINISHED'}
|
return {'FINISHED'}
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user