-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
properties.py
129 lines (88 loc) · 5.49 KB
/
properties.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
import bpy
class ANTemplatesNodetrees(bpy.types.PropertyGroup) :
'''name : StringProperty() '''
description : bpy.props.StringProperty(name="Description")
blender_version : bpy.props.StringProperty(name="Blender Version")
an_version : bpy.props.StringProperty(name="Animation Nodes Version")
category : bpy.props.StringProperty(name="Category")
tags : bpy.props.StringProperty(name="Tags")
hash : bpy.props.StringProperty(name="Nodetree Hash")
image_preview_url : bpy.props.StringProperty(name="Image Preview")
video_preview_url : bpy.props.StringProperty(name="Video Preview")
file_url : bpy.props.StringProperty(name="File URL")
readme_url : bpy.props.StringProperty(name="Readme URL")
downloaded : bpy.props.BoolProperty(name="Available Offline")
class ANTemplatesBlenderVersions(bpy.types.PropertyGroup) :
'''name : StringProperty() '''
class ANTemplatesANVersions(bpy.types.PropertyGroup) :
'''name : StringProperty() '''
class ANTemplatesCategories(bpy.types.PropertyGroup) :
'''name : StringProperty() '''
class ANTemplatesTags(bpy.types.PropertyGroup) :
'''name : StringProperty() '''
class ANTemplatesNews(bpy.types.PropertyGroup) :
'''name : StringProperty() '''
url : bpy.props.StringProperty(name="News URL")
nodetree_name : bpy.props.StringProperty(name="Nodetree Name")
def get_categories_callback(scene, context):
items = []
items.append(("ALL", "All", ""))
for i in context.window_manager.an_templates_properties.categories:
items.append((i.name, i.name, ""))
return items
def get_categories_submission_callback(scene, context):
items = []
items.append(("CHOOSE_CATEGORY", "Choose Category", ""))
items.append(("NEW_CATEGORY", "New Category", ""))
for i in context.window_manager.an_templates_properties.categories:
items.append((i.name, i.name, ""))
return items
def get_an_nodetree_callback(scene, context):
items = []
items.append(("CHOOSE_NODETREE", "Choose NodeTree", ""))
for n in bpy.data.node_groups:
if n.bl_idname == "an_AnimationNodeTree":
items.append((n.name, n.name, ""))
return items
class ANTemplatesProperties(bpy.types.PropertyGroup) :
'''name : StringProperty() '''
blender_versions : bpy.props.CollectionProperty(type = ANTemplatesBlenderVersions, name="Blender Versions")
an_versions : bpy.props.CollectionProperty(type = ANTemplatesANVersions, name="Animation Nodes Verions")
categories : bpy.props.CollectionProperty(type = ANTemplatesCategories, name="Categories")
tags : bpy.props.CollectionProperty(type = ANTemplatesTags, name="Tags")
nodetrees_index : bpy.props.IntProperty(name="Nodetrees Index")
manifest_hash : bpy.props.StringProperty(name="Manifest Hash")
import_original_scene : bpy.props.BoolProperty(name="Import Original Scene")
keep_original_objects : bpy.props.BoolProperty(name="Keep Original Objects")
original_object_specific_collection : bpy.props.StringProperty(name="Specific Collection", default = "Collection")
original_objects_collection_items = [
('SPECIFIC', 'Specific', ""),
('ACTIVE', 'Active', ""),
('SCENE', 'Scene', ""),
]
original_objects_collection : bpy.props.EnumProperty(name="Original Objects Collection", items = original_objects_collection_items, default='SCENE')
output_nodetree_info_file : bpy.props.StringProperty(name="Output Nodetree Info", subtype="FILE_PATH")
show_import_options : bpy.props.BoolProperty(name="Show Import Options")
show_nodetree_infos : bpy.props.BoolProperty(name="Show Nodetree Infos")
nodetree_categories_enum : bpy.props.EnumProperty(name="Categories", items = get_categories_callback)
nodetree_search : bpy.props.StringProperty(name="Search", description = "Search for Nodetree and Tags if activated, use a + between Tags", options={'TEXTEDIT_UPDATE','SKIP_SAVE'})
nodetree_tag_search : bpy.props.BoolProperty(name="Tag Search Toggle", default = True)
submission_nodetree : bpy.props.EnumProperty(name="Nodetree", description="Submitted NodeTree", items = get_an_nodetree_callback)
submission_readme : bpy.props.PointerProperty(name="Readme", description="Extensive Description of the Nodetree and How to use it in a Text Block", type=bpy.types.Text)
submission_tags : bpy.props.StringProperty(name="Tags, Comma Separated")
submission_category : bpy.props.EnumProperty(name="Category", items = get_categories_submission_callback)
submission_small_description : bpy.props.StringProperty(name="Small Description")
submission_image_preview_url : bpy.props.StringProperty(name="Image Preview URL", description="Add Custom Image Preview, if Empty, a blender screenshot will be used", subtype="FILE_PATH")
submission_video_preview_url : bpy.props.StringProperty(name="Video Preview URL")
submission_author_mail : bpy.props.StringProperty(name="Your Mail")
submission_author_name : bpy.props.StringProperty(name="Your Name")
submission_side_notes : bpy.props.StringProperty(name="Side Notes")
k_v : bpy.props.StringProperty()
update_needed : bpy.props.BoolProperty()
update_message : bpy.props.StringProperty()
update_download_url : bpy.props.StringProperty()
#newsfeed
newsfeed_hash : bpy.props.StringProperty(name="Newsfeed Hash")
news : bpy.props.CollectionProperty(type = ANTemplatesNews, name="News")
temp_news : bpy.props.CollectionProperty(type = ANTemplatesNews, name="Temp News")
active_news : bpy.props.IntProperty()