MegaBag/data/m7a_area.py

82 lines
2.8 KiB
Python

#!/usr/bin/env python -------------------------------- -*- coding: utf-8 -*-#
# 2023 3DMish <Mish7913@gmail.com> #
# ----- ##### 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 2 #
# 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. #
# #
# ----- ##### END GPL LICENSE BLOCK ##### ----- #
import os, sys;
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)) + "/");
from bpy_sys import (
q_register_class, q_unregister_class, ver_more,
r_unregister_class, r_register_class, ver_less,
);
if ver_more(2,65,0): from bpy.types import Menu;
if ver_less(2,79,5):
bl_conf = {
}
else:
bl_conf = {
"INFO_MT_area": None,
}
if ver_more(2,65,0):
class SCREEN_MT_area (Menu):
bl_label = "Area";
def draw(self, context):
lc_main = self.layout;
if context.space_data.type == 'VIEW_3D':
lc_main.operator("screen.region_quadview");
lc_main.separator();
lc_main.operator("screen.area_split", text="Horizontal Split").direction = 'HORIZONTAL';
lc_main.operator("screen.area_split", text="Vertical Split").direction = 'VERTICAL';
lc_main.separator(); # ---------------------------
lc_main.operator("screen.screen_full_area");
lc_main.operator("screen.screen_full_area", text="Toggle Fullscreen Area").use_hide_panels = True;
lc_main.operator("screen.area_dupli");
lc_main.separator(); # ---------------------------
lc_main.operator("screen.area_close");
if ver_less(2,65,0):
classes = [
];
elif ver_less(2,79,5):
classes = [
SCREEN_MT_area,
];
else:
classes = [
SCREEN_MT_area,
];
def register ():
global bl_conf;
r_unregister_class(bl_conf);
q_register_class(classes);
def unregister ():
global bl_conf;
q_unregister_class(classes);
r_register_class(bl_conf);