-
Notifications
You must be signed in to change notification settings - Fork 4
/
nns_object.py
35 lines (27 loc) · 932 Bytes
/
nns_object.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import bpy
from bpy.props import EnumProperty
class NTR_PT_object(bpy.types.Panel):
bl_label = "NNS Object Options"
bl_idname = "OBJECT_PT_nns"
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "object"
bl_options = {'HIDE_HEADER'}
def draw(self, context):
layout = self.layout
obj = context.object
layout = layout.box()
title = layout.column()
title.box().label(text="NNS Object Options")
layout.prop(obj, "nns_billboard")
def object_register():
billboard_items = [
("off", "Off", '', 1),
("on", "Always face camera", '', 2),
("y_on", "Only face camera on y axis", '', 3)
]
bpy.types.Object.nns_billboard = EnumProperty(
name="Billboard settings", items=billboard_items)
bpy.utils.register_class(NTR_PT_object)
def object_unregister():
bpy.utils.unregister_class(NTR_PT_object)