-
Notifications
You must be signed in to change notification settings - Fork 254
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
58 changed files
with
1,518 additions
and
791 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# ====================== BEGIN GPL LICENSE BLOCK ============================ | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
# All rights reserved. | ||
# | ||
# ======================= END GPL LICENSE BLOCK ============================= | ||
|
||
# ---------------------------------------------- | ||
# BBPL -> BleuRaven Blender Python Library | ||
# BleuRaven.fr | ||
# XavierLoux.com | ||
# ---------------------------------------------- | ||
|
||
import bpy | ||
import importlib | ||
from . import utils | ||
|
||
if "utils" in locals(): | ||
importlib.reload(utils) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# ====================== BEGIN GPL LICENSE BLOCK ============================ | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
# All rights reserved. | ||
# | ||
# ======================= END GPL LICENSE BLOCK ============================= | ||
|
||
# ---------------------------------------------- | ||
# BBPL -> BleuRaven Blender Python Library | ||
# BleuRaven.fr | ||
# XavierLoux.com | ||
# ---------------------------------------------- | ||
|
||
import bpy | ||
|
||
def get_package_name(): | ||
package_name = __package__ | ||
package_name = package_name.split(".")[0] | ||
package_name = package_name.lower().replace("-", "") | ||
return package_name | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
blender-for-unrealengine/bbpl/blender_layout/layout_accordion/functions.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# ====================== BEGIN GPL LICENSE BLOCK ============================ | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
# All rights reserved. | ||
# | ||
# ======================= END GPL LICENSE BLOCK ============================= | ||
|
||
# ---------------------------------------------- | ||
# BBPL -> BleuRaven Blender Python Library | ||
# BleuRaven.fr | ||
# XavierLoux.com | ||
# ---------------------------------------------- | ||
|
||
import bpy | ||
from . import types | ||
|
||
def add_ui_accordion(name: str=""): | ||
return bpy.props.PointerProperty(type=types.get_layout_accordion_class(), name=name) |
84 changes: 84 additions & 0 deletions
84
blender-for-unrealengine/bbpl/blender_layout/layout_accordion/types.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
# ====================== BEGIN GPL LICENSE BLOCK ============================ | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
# All rights reserved. | ||
# | ||
# ======================= END GPL LICENSE BLOCK ============================= | ||
|
||
# ---------------------------------------------- | ||
# BBPL -> BleuRaven Blender Python Library | ||
# BleuRaven.fr | ||
# XavierLoux.com | ||
# ---------------------------------------------- | ||
|
||
import bpy | ||
from . import utils | ||
from ... import __internal__ | ||
|
||
layout_accordion_class = None | ||
|
||
def get_layout_accordion_class(): | ||
global layout_accordion_class | ||
return layout_accordion_class | ||
|
||
|
||
def create_ui_accordion_class(): | ||
# Create an custom class ussing addon name for avoid name collision. | ||
|
||
class CustomAccordionUI_PropertyGroup(bpy.types.PropertyGroup): | ||
expend: bpy.props.BoolProperty( | ||
name="Use", | ||
description="Click to expand / collapse", | ||
default=False | ||
) | ||
|
||
def get_name(self): | ||
if bpy.app.version >= (3, 0, 0): | ||
prop_rna = self.id_data.bl_rna.properties[self.id_properties_ensure().name] | ||
return prop_rna.name | ||
else: | ||
prop_rna = self.id_data.bl_rna.properties[self.path_from_id()] | ||
return prop_rna.name | ||
|
||
|
||
def draw(self, layout: bpy.types.UILayout): | ||
tria_icon = "TRIA_DOWN" if self.expend else "TRIA_RIGHT" | ||
description = "Click to collapse" if self.expend else "Click to expand" | ||
layout.row().prop(self, "expend", icon=tria_icon, icon_only=True, text=self.get_name(), emboss=False, toggle=True, expand=True) | ||
if self.expend: | ||
pass | ||
|
||
def is_expend(self): | ||
return self.expend | ||
|
||
CustomAccordionUI_PropertyGroup.__name__ = utils.get_class_name() | ||
return CustomAccordionUI_PropertyGroup | ||
|
||
classes = ( | ||
) | ||
|
||
def register(): | ||
global layout_accordion_class | ||
for cls in classes: | ||
bpy.utils.register_class(cls) | ||
|
||
BBPL_UI_Accordion = create_ui_accordion_class() | ||
layout_accordion_class = BBPL_UI_Accordion | ||
bpy.utils.register_class(BBPL_UI_Accordion) | ||
|
||
|
||
|
||
def unregister(): | ||
for cls in reversed(classes): | ||
bpy.utils.unregister_class(cls) |
32 changes: 32 additions & 0 deletions
32
blender-for-unrealengine/bbpl/blender_layout/layout_accordion/utils.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# ====================== BEGIN GPL LICENSE BLOCK ============================ | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
# All rights reserved. | ||
# | ||
# ======================= END GPL LICENSE BLOCK ============================= | ||
|
||
# ---------------------------------------------- | ||
# BBPL -> BleuRaven Blender Python Library | ||
# BleuRaven.fr | ||
# XavierLoux.com | ||
# ---------------------------------------------- | ||
|
||
import bpy | ||
|
||
from ... import __internal__ | ||
|
||
def get_class_name(): | ||
package_name = __internal__.utils.get_package_name() | ||
return f"BBPL_UI_{package_name}_Accordion" | ||
|
Oops, something went wrong.