-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMovieColab_addon.py
784 lines (625 loc) · 24.9 KB
/
MovieColab_addon.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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
bl_info = {
"name": "MovieColab",
"author": "Sarthak Mehta",
"version": (1, 0),
"blender": (2, 80, 0),
"location": "View3D > MovieColab",
"description": "Blender Add On for Movie Colab",
"warning": "",
"doc_url": "",
"category": "Movie Colab",
}
import requests
import json
import bpy
import os
filepath = ""
directory = ""
MOVCOLAB_URL= 'https://movie-colab-prod-service-facgkefmpa-as.a.run.app/'
SSO_URL='https://sso-prod-service-txevaj6mmq-as.a.run.app/'
valid=False
token=""
project={}# stores project info{id,name}
Project_names=[]
project_dict={}
sequences={} # stores project->sequences{id,name,code}
sequences_names=[]
sequence_dict={}
shots={}# stores shots string
Shot_names=[]
shot_dict={}
tasks={}#stores tasks string
Task_names=[]
task_dict={}
asset={}
asset_dict={}
Asset_names=[]
name=""
asset_version={}
first_login=0
x=""
def get_token(mail, password):
details = {
'email': mail,
'password': password
}
res = requests.post(SSO_URL+"api/token/", json=details)
global filepath
global directory
global token
global first_login
global x
if(res.status_code<300):
access_token=res
filepath = bpy.data.filepath
directory = os.path.dirname(filepath)
token=res.json()['access']
first_login=1
x=token
return True
else:
return False
def get_project():
r=requests.get(MOVCOLAB_URL+"project/",headers={'Authorization':'Bearer '+str(x)})
return r.json()
def get_sequences(project_id):
r=requests.get(MOVCOLAB_URL+"trackables/shot-sequence?project="+str(project_id),headers={'Authorization':'Bearer '+str(x)})
return r.json()
def get_shot(project_id,sequence_id):
r=requests.get(MOVCOLAB_URL+"trackables/shot?project="+str(project_id)+"&parent_sequence="+str(sequence_id),headers={'Authorization':'Bearer '+x})
return r.json()
def get_Shot_version(shot_id):
r=requests.get(MOVCOLAB_URL+"trackables/shot-version?shot="+str(shot_id),headers={'Authorization':'Bearer '+x})
return(r.json())
def create_shot_SS(name,shot):
data={
"name": "String",
"shot": 0,
}
data["name"]=name
data["shot"]=shot
ss_directory=str(directory)+"\\"+str(name)+'.png'
print(ss_directory)
if(os.path.isfile(ss_directory)):
files=[('file',(ss_directory,open(ss_directory,'rb')))]
r=requests.post(MOVCOLAB_URL+"trackables/shot-version/",headers={'Authorization':'Bearer '+x},data=data,files=files)
return (r.status_code)
else:
return 101
def create_shot_sequence(name,shot):
data={
"name": "String",
"shot": 0,
}
data["name"]=name
data["shot"]=shot
ss_directory=str(directory)+"\\"+str(name)+'.mp4'
print(ss_directory)
if(os.path.isfile(ss_directory)):
files=[('file',(ss_directory,open(ss_directory,'rb')))]
r=requests.post(MOVCOLAB_URL+"trackables/shot-version/",headers={'Authorization':'Bearer '+x},data=data,files=files)
return (r.status_code)
else:
return 101
def get_task(project_id,shot_id):
r=requests.get(MOVCOLAB_URL+"trackables/task/?project="+str(project_id)+"&linked="+str(shot_id)+"&assigned=1",headers={'Authorization':'Bearer '+str(x)})
return r.json()
def render_and_save(name):
render_name=name+'.png'
bpy.context.scene.render.filepath = os.path.join(directory, (render_name))
bpy.context.scene.render.image_settings.file_format = 'PNG'
bpy.ops.render.view_show('INVOKE_DEFAULT')
bpy.ops.render.render(animation=False,write_still=True, use_viewport=True)
def render_anim(name):
render_name=name+'.mp4'
bpy.context.scene.render.filepath = os.path.join(directory, (render_name))
bpy.context.scene.render.image_settings.file_format = 'FFMPEG'
bpy.context.scene.render.ffmpeg.format = 'MPEG4'
bpy.ops.render.render(animation=True,write_still=True, use_viewport=True)
bpy.ops.render.play_rendered_anim('INVOKE_DEFAULT')
def MessageBox(message = "", title = "Message Box", icon = 'INFO'):
def draw(self, context):
self.layout.label(text=message)
bpy.context.window_manager.popup_menu(draw, title = title, icon = icon)
class Sequences(bpy.types.Operator):
"""Tooltip"""
bl_idname = "object.user_sequence"
bl_label = "Get Sequences"
bl_options = {"UNDO"}
@classmethod
def poll(cls, context):
return context.active_object is not None
def execute(self, context):
mycred=bpy.context.scene.cred
global sequences
global sequences_names
sequences_names.clear()
global sequence_dict
sequence_dict.clear()
if(mycred.Project!=""):
sequences=get_sequences(project['results'][project_dict[mycred.Project]]['id'])
for i in range(sequences['count']):
sequence_dict[sequences['results'][i]['code']]=i
for i in range(sequences['count']):
sequences_names.append((sequences['results'][i]['code'],sequences['results'][i]['code'],""))
else:
MessageBox("No projects available","Sequence")
return{'FINISHED'}
class ProjectInfo(bpy.types.Operator):
"""Tooltip"""
bl_idname = "object.user_project"
bl_label = "Get Project Info"
bl_options = {"UNDO"}
@classmethod
def poll(cls, context):
return context.active_object is not None
def execute(self, context):
mycred=bpy.context.scene.cred
global project
global Project_names
Project_names.clear()
global project_dict
project_dict.clear()
project=get_project()
#Create project dictionary
if(valid):
for i in range(project['count']):
project_dict[project['results'][i]['name']]=i
for i in range(project['count']):
Project_names.append((project['results'][i]['name'],project['results'][i]['name'],""))
else:
MessageBox("Can't access projects","Projects",'ERROR')
return{'FINISHED'}
class Shot_list(bpy.types.Operator):
"""Tooltip"""
bl_idname = "object.user_shot_list"
bl_label = "Get shots list"
bl_options = {"UNDO"}
@classmethod
def poll(cls, context):
return context.active_object is not None
def execute(self, context):
mycred=bpy.context.scene.cred
global shots
global Shot_names
Shot_names.clear()
global shot_dict
shot_dict.clear()
if(mycred.Project!="" and mycred.Sequence!=""):
shots=get_shot(project['results'][project_dict[mycred.Project]]['id'],sequences['results'][sequence_dict[mycred.Sequence]]['id'])
for i in range(shots['count']):
shot_dict[shots['results'][i]['code']]=i
for i in range(shots['count']):
Shot_names.append((shots['results'][i]['code'],shots['results'][i]['code'],""))
else:
MessageBox("No sequence available","Shot")
return{'FINISHED'}
class Create_Shot(bpy.types.Operator):
"""Tooltip"""
bl_idname = "object.create_shot"
bl_label = "Create shot"
bl_options = {"UNDO"}
@classmethod
def poll(cls, context):
return context.active_object is not None
def execute(self, context):
mycred=bpy.context.scene.cred
if(mycred.Shot!=""):
shot=shots['results'][shot_dict[mycred.Shot]]['id']
version=get_Shot_version(shots['results'][shot_dict[mycred.Shot]]['id'])
if(version['count']!=0):
index=version['count']-1
version_name=version['results'][index]['name']
shot_num=int(version_name[version_name.find('v')+2:])+1
name_SS=mycred.Shot.replace(" ","_")+'.'+mycred.Task.replace(" ","_")+'.'+'v'+(3-len(str(shot_num)))*"0"+str(shot_num)
else:
name_SS=mycred.Shot.replace(" ","_")+'.'+mycred.Task.replace(" ","_")+'.'+"v001"
statuscode=create_shot_SS(name_SS,shot)
if(statuscode==401):
MessageBox("Failed","Sequence Shot version upload",'ERROR')
elif(statuscode==201):
MessageBox("Success","Sequence Shot version upload")
elif(statuscode==101):
MessageBox("No such file in the directory","Sequence Shot version upload")
else:
MessageBox("No shots to upload","Sequence Shot version upload")
return{'FINISHED'}
class Create_Shot_sequence(bpy.types.Operator):
"""Tooltip"""
bl_idname = "object.create_shot_sequence"
bl_label = "Create shot sequence"
bl_options = {"UNDO"}
@classmethod
def poll(cls, context):
return context.active_object is not None
def execute(self, context):
mycred=bpy.context.scene.cred
if(mycred.Shot!=""):
shot=shots['results'][shot_dict[mycred.Shot]]['id']
version=get_Shot_version(shots['results'][shot_dict[mycred.Shot]]['id'])
if(version['count']!=0):
index=version['count']-1
version_name=version['results'][index]['name']
shot_num=int(version_name[version_name.find('v')+2:])+1
name_Seq=mycred.Shot.replace(" ","_")+'.'+mycred.Task.replace(" ","_")+'.'+'v'+(3-len(str(shot_num)))*"0"+str(shot_num)
else:
name_Seq=mycred.Shot.replace(" ","_")+'.'+mycred.Task.replace(" ","_")+'.'+"v001"
statuscode=create_shot_sequence(name_Seq,shot)
if(statuscode==401):
MessageBox("Failed","Sequence Shot version upload",'ERROR')
elif(statuscode==201):
MessageBox("Success","Sequence Shot version upload")
elif(statuscode==101):
MessageBox("No such file in the directory","Sequence Shot version upload")
else:
MessageBox("No shots to upload","Sequence Shot version upload")
return{'FINISHED'}
class Tasks(bpy.types.Operator):
"""Tooltip"""
bl_idname = "object.user_tasks"
bl_label = "Get tasks assigned"
bl_options = {"UNDO"}
@classmethod
def poll(cls, context):
return context.active_object is not None
def execute(self, context):
mycred=bpy.context.scene.cred
global tasks
global Task_names
Task_names.clear()
global task_dict
task_dict.clear()
if(mycred.Project!="" and mycred.Shot!=""):
tasks=get_task(project['results'][project_dict[mycred.Project]]['id'],shots['results'][shot_dict[mycred.Shot]]['id'])
for i in range(tasks['count']):
task_dict[tasks['results'][i]['name']]=i
for i in range(tasks['count']):
Task_names.append((tasks['results'][i]['name'],tasks['results'][i]['name'],""))
else:
MessageBox("No shots available","Tasks")
return{'FINISHED'}
class Render(bpy.types.Operator):
"""Tooltip"""
bl_idname = "object.render_scene"
bl_label = "Render scene"
bl_options = {"UNDO"}
@classmethod
def poll(cls, context):
return context.active_object is not None
def execute(self, context):
mycred=bpy.context.scene.cred
global name
if(mycred.Shot!=""):
version=get_Shot_version(shots['results'][shot_dict[mycred.Shot]]['id'])
if(version['count']!=0):
index=version['count']-1
version_name=version['results'][index]['name']
shot_num=int(version_name[version_name.find('v')+2:])+1
name=mycred.Shot.replace(" ","_")+'.'+mycred.Task.replace(" ","_")+'.'+'v'+(3-len(str(shot_num)))*"0"+str(shot_num)
else:
name=mycred.Shot.replace(" ","_")+'.'+mycred.Task.replace(" ","_")+'.'+"v001"
render_and_save(name)
else:
MessageBox("No shot version available","Render")
return{'FINISHED'}
class Render_animation(bpy.types.Operator):
"""Tooltip"""
bl_idname = "object.render_animation"
bl_label = "Render animation"
bl_options = {"UNDO"}
@classmethod
def poll(cls, context):
return context.active_object is not None
def execute(self, context):
mycred=bpy.context.scene.cred
global name
if(mycred.Shot!=""):
version=get_Shot_version(shots['results'][shot_dict[mycred.Shot]]['id'])
if(version['count']!=0):
index=version['count']-1
version_name=version['results'][index]['name']
shot_num=int(version_name[version_name.find('v')+2:])+1
name=mycred.Shot.replace(" ","_")+'.'+mycred.Task.replace(" ","_")+'.'+'v'+(3-len(str(shot_num)))*"0"+str(shot_num)
else:
name=mycred.Shot.replace(" ","_")+'.'+mycred.Task.replace(" ","_")+'.'+"v001"
render_anim(name)
else:
MessageBox("No shot version available","Render")
return{'FINISHED'}
class AddUser(bpy.types.Operator):
"""Tooltip"""
bl_idname = "object.user_register"
bl_label = "Add User"
bl_options = {"UNDO"}
@classmethod
def poll(cls, context):
return context.active_object is not None
def execute(self, context):
mycred=bpy.context.scene.cred
global valid
valid=get_token(mycred.Email,mycred.Password)
if(valid):
MessageBox("Successful","Login")
bpy.app.timers.register(update)
else:
MessageBox("Failed","Login",'ERROR')
return{'FINISHED'}
class LogOut(bpy.types.Operator):
"""Tooltip"""
bl_idname = "object.user_logout"
bl_label = "LogOut"
bl_options = {"UNDO"}
@classmethod
def poll(cls, context):
return context.active_object is not None
def execute(self, context):
mycred=bpy.context.scene.cred
mycred.Email=""
mycred.Password=""
global Project_names
Project_names=[]
global sequences_names
sequences_names=[]
global Shot_names
Shot_names=[]
global Task_names
Task_names=[]
global Asset_names
Asset_names=[]
global token
token=""
global x
x=""
global project
project={}
global sequences
sequences={}
global shots
shots={}
global tasks
tasks={}
global asset
asset={}
global name
name=""
global asset_version
asset_version={}
mycred.Asset_version=""
first_login=0
bpy.app.timers.unregister(update)
return{'FINISHED'}
def get_names(self,context):
return Project_names
def get_sequences_names(self,context):
return sequences_names
def get_shot_version(self,context):
return Shot_names
def get_task_name(self,context):
return Task_names
def get_assets_names(self,context):
return Asset_names
class Credentials(bpy.types.PropertyGroup):
Project : bpy.props.EnumProperty(
name = "Projects",
description = "enum desc",
items = get_names
)
Sequence : bpy.props.EnumProperty(
name = "Sequences",
description = "enum desc",
items = get_sequences_names
)
Shot : bpy.props.EnumProperty(
name = "Shots",
description = "enum desc",
items = get_shot_version
)
Task : bpy.props.EnumProperty(
name = "Tasks",
description = "enum desc",
items = get_task_name
)
Assets_list : bpy.props.EnumProperty(
name = "Assets",
description = "enum desc",
items = get_assets_names
)
Asset_version : bpy.props.StringProperty(name="Version")
Email:bpy.props.StringProperty(name="Username")
Password:bpy.props.StringProperty(name="Password",subtype='PASSWORD')
class LoginPanel(bpy.types.Panel):
bl_label = "Sequence Tab"
bl_space_type = "VIEW_3D"
bl_region_type = "UI"
bl_category = "MovieColab"
bl_options = {"DEFAULT_CLOSED"}
def draw(self, context):
layout = self.layout
scene = context.scene
mycred = scene.cred
col = layout.column(align=True)
row = col.row(align=True)
layout.prop(mycred,"Email")
layout.prop(mycred,"Password")
row=layout.row()
row.operator(AddUser.bl_idname, text="Login")
row=layout.row()
row.operator(ProjectInfo.bl_idname, text="Get Projects")
layout.prop(mycred,"Project")
row=layout.row()
row.operator(Sequences.bl_idname, text="Get Sequences")
layout.prop(mycred,"Sequence")
row=layout.row()
row.operator(Shot_list.bl_idname, text="Get Shots")
layout.prop(mycred,"Shot")
row=layout.row()
row.operator(Tasks.bl_idname, text="Get Tasks Assigned")
layout.prop(mycred,"Task")
row=layout.row()
row.operator(Render.bl_idname, text="Render")
row=layout.row()
row.operator(Create_Shot.bl_idname, text="Upload rendered image")
row=layout.row()
row.operator(Render_animation.bl_idname, text="Render Sequence")
row=layout.row()
row.operator(Create_Shot_sequence.bl_idname, text="Upload Sequence")
row=layout.row()
row.operator(LogOut.bl_idname, text="Log Out")
# Assets Portion
def get_asset_list(project_id):
r=requests.get(MOVCOLAB_URL+"trackables/asset/?project="+str(project_id),headers={'Authorization':'Bearer '+x})
return r.json()
def get_asset_versions(id):
r=requests.get(MOVCOLAB_URL+"trackables/asset-version?asset="+str(id),headers={'Authorization':'Bearer '+x})
return r.json()
def create_asset_version(name,asset):
data={
"name": "String",
"asset":0,
}
data["name"]=name
data["asset"]=asset
ss_directory=str(directory)+"\\"+str(name)+'.mp4'
if(os.path.isfile(ss_directory)):
files=[('file',(ss_directory,open(ss_directory,'rb')))]
r=requests.post(MOVCOLAB_URL+"trackables/asset-version/",headers={'Authorization':'Bearer '+x},data=data,files=files)
return (r.status_code)
else:
return 101
class Assets(bpy.types.Operator):
"""Tooltip"""
bl_idname = "object.user_assets"
bl_label = "Get assets"
bl_options = {"UNDO"}
@classmethod
def poll(cls, context):
return context.active_object is not None
def execute(self, context):
mycred=bpy.context.scene.cred
global asset
global Asset_names
Asset_names.clear()
global asset_dict
asset_dict.clear()
if(mycred.Project!=""):
asset=get_asset_list(project['results'][project_dict[mycred.Project]]['id'])
for i in range(asset['count']):
asset_dict[asset['results'][i]['name']]=i
for i in range(asset['count']):
Asset_names.append((asset['results'][i]['name'],asset['results'][i]['name'],""))
else:
MessageBox("No project available","Assets")
return{'FINISHED'}
class Asset_Version(bpy.types.Operator):
bl_idname = "object.user_assets_version"
bl_label = "Get assets version"
bl_options = {"UNDO"}
@classmethod
def poll(cls, context):
return context.active_object is not None
def execute(self, context):
mycred=bpy.context.scene.cred
global asset_version
if(mycred.Assets_list!=""):
asset_version=get_asset_versions(asset['results'][asset_dict[mycred.Assets_list]]['id'])
if(asset_version['count']!=0):
index=asset_version['count']-1
mycred.Asset_version=asset_version['results'][index]['name']
else:
mycred.Asset_version=""
else:
mycred.Asset_version=""
MessageBox("No assets available","Asset Version")
return{'FINISHED'}
class Render_asset(bpy.types.Operator):
"""Tooltip"""
bl_idname = "object.render_asset_animation"
bl_label = "Render asset animation"
bl_options = {"UNDO"}
@classmethod
def poll(cls, context):
return context.active_object is not None
def execute(self, context):
mycred=bpy.context.scene.cred
global name_asset
if(mycred.Assets_list!=""):
if(asset_version['count']!=0):
version_name=mycred.Asset_version
shot_num=int(version_name[version_name.find('v')+2:])+1
name_asset=mycred.Assets_list.replace(" ","_")+'.'+'v'+(3-len(str(shot_num)))*"0"+str(shot_num)
else:
name_asset=mycred.Assets_list.replace(" ","_")+'.'+"v001"
render_anim(name_asset)
else:
MessageBox("No assets available","Render")
return{'FINISHED'}
class upload_asset_sequence(bpy.types.Operator):
"""Tooltip"""
bl_idname = "object.upload_asset_sequence"
bl_label = "Upload asset sequence"
bl_options = {"UNDO"}
@classmethod
def poll(cls, context):
return context.active_object is not None
def execute(self, context):
mycred=bpy.context.scene.cred
if(mycred.Assets_list!=""):
Asset=asset['results'][asset_dict[mycred.Assets_list]]['id']
if(asset_version['count']!=0):
version_name=mycred.Asset_version
shot_num=int(version_name[version_name.find('v')+2:])+1
Name=mycred.Assets_list.replace(" ","_")+'.'+'v'+(3-len(str(shot_num)))*"0"+str(shot_num)
else:
Name=mycred.Assets_list.replace(" ","_")+'.'+"v001"
statuscode=create_asset_version(Name,Asset)
if(statuscode==401):
MessageBox("Failed","Asset Sequence upload",'ERROR')
elif(statuscode==201):
MessageBox("Success","Asset Sequence upload")
elif(statuscode==101):
MessageBox("No such file in the directory","Asset Sequence upload")
else:
MessageBox("No sequence to upload","Asset Sequence upload")
return{'FINISHED'}
def update():
mycred=bpy.context.scene.cred
if (first_login==1):
get_token(mycred.Email,mycred.Password)
return 300
class AssetPanel(bpy.types.Panel):
bl_label = "Asset Tab"
bl_space_type = "VIEW_3D"
bl_region_type = "UI"
bl_category = "MovieColab"
bl_options = {"DEFAULT_CLOSED"}
def draw(self, context):
layout = self.layout
scene = context.scene
mycred = scene.cred
col = layout.column(align=True)
row = col.row(align=True)
layout.label(text=mycred.Email)
row=layout.row()
row.operator(ProjectInfo.bl_idname, text="Get Projects")
layout.prop(mycred,"Project")
row=layout.row()
row.operator(Assets.bl_idname, text="Get Assets")
layout.prop(mycred,"Assets_list")
row=layout.row()
row.operator(Asset_Version.bl_idname, text="Get Asset Version")
layout.prop(mycred,"Asset_version")
row=layout.row()
row.operator(Render_asset.bl_idname, text="Render asset Sequence")
row=layout.row()
row.operator(upload_asset_sequence.bl_idname, text="Upload Sequence")
classes = [Credentials,LoginPanel,AssetPanel,AddUser,ProjectInfo,Sequences,Assets,Asset_Version,Render_asset,upload_asset_sequence,Shot_list,Tasks,Render,Create_Shot,Render_animation,Create_Shot_sequence,LogOut]
def register():
for cls in classes:
bpy.utils.register_class(cls)
bpy.types.Scene.cred = bpy.props.PointerProperty(type = Credentials)
def unregister():
for cls in classes:
bpy.utils.unregister_class(cls)
del bpy.types.Scene.cred
if __name__ == "__main__":
register()