-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathblender-organizer.py
564 lines (393 loc) · 15.5 KB
/
blender-organizer.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
# -*- coding: utf-8 -*-
# THIS IS A REWRITE ATTEMPT OF THE ORGINIZER
# THIS MAY MAKE THE ORGINIZER IT SELF MORE
# ORGINIZED LOL
# TRYING TO GET VERSION FROM UPDATE FILE
try:
up = open("update_info.data", "r")
VERSION = float(up.read().split("\n")[0][len("VERSION "):])
except:
VERSION = 0.0
savename = open("MAIN_FILE", "w")
savename.write(str(__file__))
savename.close()
### IMPORTING MODULES
ER = 0
try: # GIVING THE USER ALL NEEDED INFORMATION IF MODULES ARE MISSING
# system
import os
import socket
# calculational help
import datetime
import urllib2
import subprocess
import platform
#1.0/0 # TESTER
except:
ER = 1
from py_data.modules import troubleshooter
troubleshooter.shoot(ER)
ostype = platform.system()
if ostype == "Windows":
from py_data.modules import troubleshooter
troubleshooter.shoot(0)
try:
# graphics interface
import gtk
import pango
import cairo
import glib
#1.0/0
except:
ER = 2
from py_data.modules import troubleshooter
troubleshooter.shoot(ER)
try:
try:
import Image
except:
from PIL import Image
#1.0/0
except:
ER = 3
from py_data.modules import troubleshooter
troubleshooter.shoot(ER)
### IMPORTING OUR EXTENDED MODULES
from py_data.modules import analytics
from py_data.modules import assets
from py_data.modules import story_editor
from py_data.modules import checklist
from py_data.modules import schedule
from py_data.modules import update_window
from py_data.modules import blendver
from py_data.modules import history
from py_data.modules import oscalls
### FILES FOLDERS MAKE SURE
# py_data bullshit
history.write(os.getcwd(), "/", "[Project Started]") # THIS MESSAGE WILL BE GONE AUTOMATICALLY
# I'M KEEPING IT IN SO AFTER UPDATE IT WILL
# WIPE THE HISTORY FROM THIS TYPE OF SPAM (07/08/2020) # IF IT'S OLD REMOVE THIS.
os.system("notify-send -i "+os.getcwd()+"/py_data/icon.png Blender-Organizer :\)\ I\\'m\ happy\ to\ see\ you.") # THIS IS THE NEW SOLUTION OF GREETINGS
# LOOK IN THE END OF THE FILE FOR ONE THAT
# SAYS BYE BYE
#make sure schedule.data exists
if os.path.exists(os.getcwd()+"/schedule.data") == False:
s = open(os.getcwd()+"/schedule.data", "w")
s.close()
# others
try:
os.mkdir(os.getcwd()+"/ast")
os.mkdir(os.getcwd()+"/ast/chr")
os.mkdir(os.getcwd()+"/ast/veh")
os.mkdir(os.getcwd()+"/ast/loc")
os.mkdir(os.getcwd()+"/ast/obj")
os.mkdir(os.getcwd()+"/dev")
os.mkdir(os.getcwd()+"/dev/chr")
os.mkdir(os.getcwd()+"/dev/veh")
os.mkdir(os.getcwd()+"/dev/loc")
os.mkdir(os.getcwd()+"/dev/obj")
os.mkdir(os.getcwd()+"/mus")
os.mkdir(os.getcwd()+"/pln")
os.mkdir(os.getcwd()+"/rnd")
except:
pass
### MAIN WINDOW
# Let's Skip the old opening and make a
# part of the new main window
mainwin = gtk.Window()
mainwin.set_title("Blender Organizer " + str(VERSION))
mainwin.maximize()
mainwin.connect("destroy", lambda w: gtk.main_quit())
mainbox = gtk.VBox(False)
mainwin.add(mainbox)
gtk.window_set_default_icon_from_file("py_data/icon.png")
# Let's make a quick functions panel on the top
def buttons1():
globals()["toppannelbox"] = gtk.HBox(False)
mainbox.pack_start(toppannelbox, False)
mainbox.pack_start(gtk.HSeparator(), False)
# open project folder
projectfolder = gtk.Button()
projectfolder.props.relief = gtk.RELIEF_NONE
projectfolbox = gtk.HBox(False)
projectfolico = gtk.Image()
projectfolico.set_from_file("py_data/icons/folder.png")
projectfolbox.pack_start(projectfolico, False)
projectfolbox.pack_start(gtk.Label(" Project"))
projectfolder.add(projectfolbox)
projectfolder.set_tooltip_text("Open the "+os.getcwd())
def openpf(w=None):
oscalls.Open(os.getcwd())
projectfolder.connect("clicked",openpf)
toppannelbox.pack_start(projectfolder, False)
# open rnd folder
rndfolder = gtk.Button()
rndfolder.props.relief = gtk.RELIEF_NONE
rndfolbox = gtk.HBox(False)
rndfolico = gtk.Image()
rndfolico.set_from_file("py_data/icons/folder.png")
rndfolbox.pack_start(rndfolico, False)
rndfolbox.pack_start(gtk.Label(" Renders"))
rndfolder.add(rndfolbox)
rndfolder.set_tooltip_text("Open the "+os.getcwd()+"/rnd")
def openpf(w=None):
oscalls.Open(os.getcwd()+"/rnd")
rndfolder.connect("clicked",openpf)
#toppannelbox.pack_start(rndfolder, False)
toppannelbox.pack_start(gtk.VSeparator(), False)
#### OLD STYLE ELEMENTS BUTTONS WITH A TWIST
mainbuttonsbox = gtk.HBox()
toppannelbox.pack_start(mainbuttonsbox, False)
buttons1()
CUR = "stats"
def chgCUR(w=None, cur=CUR):
print "\033[1;31m ⬥ OPENING "+cur+" : \033[1;m"
global CUR
CUR = cur
drawmainbuttons()
drawmain()
def drawmainbuttons():
try:
global mainbuttonsbox
mainbuttonsbox.destroy()
except:
pass
mainbuttonsbox = gtk.HBox()
# scenes
scender = gtk.Button()
scender.props.relief = gtk.RELIEF_NONE
scenbox = gtk.HBox(False)
scenico = gtk.Image()
scenico.set_from_file("py_data/icons/scn_asset_undone.png")
if CUR == "rnd":
scenico.set_from_file("py_data/icons/scn_asset_done.png")
scenbox.pack_start(scenico, False)
scenbox.pack_start(gtk.Label(" Story Editor"))
scender.add(scenbox)
scender.set_tooltip_text("The Famous Blender-Organizer Story Editor")
scender.connect("clicked",chgCUR, "rnd")
mainbuttonsbox.pack_start(scender, False)
# characters
charder = gtk.Button()
charder.props.relief = gtk.RELIEF_NONE
charbox = gtk.HBox(False)
charico = gtk.Image()
charico.set_from_file("py_data/icons/chr_asset_undone.png")
if CUR == "chr":
charico.set_from_file("py_data/icons/chr_asset_done.png")
charbox.pack_start(charico, False)
charbox.pack_start(gtk.Label(" Characters"))
charder.add(charbox)
charder.set_tooltip_text("Do The People. The Characters. \nThe Humans. The Aliens.\n The Monsters")
charder.connect("clicked",chgCUR, "chr")
mainbuttonsbox.pack_start(charder, False)
# vehicles
vehider = gtk.Button()
vehider.props.relief = gtk.RELIEF_NONE
vehibox = gtk.HBox(False)
vehiico = gtk.Image()
vehiico.set_from_file("py_data/icons/veh_asset_undone.png")
if CUR == "veh":
vehiico.set_from_file("py_data/icons/veh_asset_done.png")
vehibox.pack_start(vehiico, False)
vehibox.pack_start(gtk.Label(" Vehicles"))
vehider.add(vehibox)
vehider.set_tooltip_text("People Should Have Cars. \nIK It's a little bit Hibdy Bi.\nBut I love cars so much, they have to have their own tab")
vehider.connect("clicked",chgCUR, "veh")
mainbuttonsbox.pack_start(vehider, False)
# locations
locider = gtk.Button()
locider.props.relief = gtk.RELIEF_NONE
locibox = gtk.HBox(False)
lociico = gtk.Image()
lociico.set_from_file("py_data/icons/loc_asset_undone.png")
if CUR == "loc":
lociico.set_from_file("py_data/icons/loc_asset_done.png")
locibox.pack_start(lociico, False)
locibox.pack_start(gtk.Label(" Locations"))
locider.add(locibox)
locider.set_tooltip_text("The Places. The Settings.\nThe Backgrounds. The Cities.\nThe Houses. YOU KNOW.")
locider.connect("clicked",chgCUR, "loc")
mainbuttonsbox.pack_start(locider, False)
# Objects
objider = gtk.Button()
objider.props.relief = gtk.RELIEF_NONE
objibox = gtk.HBox(False)
objiico = gtk.Image()
objiico.set_from_file("py_data/icons/obj_asset_undone.png")
if CUR == "obj":
objiico.set_from_file("py_data/icons/obj_asset_done.png")
objibox.pack_start(objiico, False)
objibox.pack_start(gtk.Label(" Other"))
objider.add(objibox)
objider.set_tooltip_text("All The Other Junk")
objider.connect("clicked",chgCUR, "obj")
mainbuttonsbox.pack_start(objider, False)
toppannelbox.pack_start(mainbuttonsbox, False)
mainbuttonsbox.show_all()
drawmainbuttons()
def secondarybuttonsOMGWTF():
toppannelbox.pack_start(gtk.VSeparator(), False)
# Analytics
startsider = gtk.Button()
startsider.props.relief = gtk.RELIEF_NONE
startsibox = gtk.HBox(False)
startsiico = gtk.Image()
startsiico.set_from_file("py_data/icons/stats.png")
startsibox.pack_start(startsiico, False)
startsibox.pack_start(gtk.Label(" Analytics"))
startsider.add(startsibox)
startsider.set_tooltip_text("Schedules, Analitycs.\nAre you doing by deadline? Ah...?")
startsider.connect("clicked",chgCUR, "stats")
toppannelbox.pack_start(startsider, False)
# checklist
checklistider = gtk.Button()
checklistider.props.relief = gtk.RELIEF_NONE
checklistibox = gtk.HBox(False)
checklistiico = gtk.Image()
checklistiico.set_from_file("py_data/icons/checklist.png")
checklistibox.pack_start(checklistiico, False)
checklistibox.pack_start(gtk.Label(" Main Checklist"))
checklistider.add(checklistibox)
checklistider.set_tooltip_text("Open Main Checklist")
checklistider.connect("clicked", checklist.checkwindow, os.getcwd(), "Main Checklist", "project.progress")
toppannelbox.pack_start(checklistider, False)
toppannelbox.pack_start(gtk.VSeparator(), False)
# SCROLLED AREA
# THIS SQUIZE THE LAST BUTTONS TO THE ORGANIZER WILL FIT INTO SMALLER SCREENS.
# SOME PEOPLE STILL USING 720p SCREENS. LIKE FAKE HD TVs AND SUCH.
# SO EFFORT SHOULD BE PUT INTO MAKING ORGANIZER COMPATIBLE WITH THOSE TINY SCREEN SIZES.
Squiz = gtk.ScrolledWindow()
Squiz.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_NEVER)
Squiz.set_size_request(50,20)
Squizbox = gtk.HBox(False)
Squiz.add_with_viewport(Squizbox)
toppannelbox.pack_end(Squiz)
# Settings AKA blender version ( I'm not going to change names of the buttons and shit)
blendverb = gtk.Button()
blendverb.props.relief = gtk.RELIEF_NONE
blendbox = gtk.HBox(False)
blendico = gtk.Image()
blendico.set_from_file("py_data/icons/settings.png")
blendbox.pack_start(blendico, False)
blendbox.pack_start(gtk.Label(" Settings"))
blendverb.add(blendbox)
blendverb.set_tooltip_text("Blender Versions, And other settings")
blendverb.connect("clicked",chgCUR, "bldv")
#blendver.set_sensitive(False)
Squizbox.pack_end(blendverb, False)
Squizbox.pack_end(gtk.VSeparator(), False)
# TELEGRAM
def telegram(w):
oscalls.Open("https://t.me/blenderorganizer")
syncider = gtk.Button()
syncider.props.relief = gtk.RELIEF_NONE
syncibox = gtk.HBox(False)
synciico = gtk.Image()
synciico.set_from_file("py_data/icons/telegram.png")
syncibox.pack_start(synciico, False)
syncibox.pack_start(gtk.Label(" Chat"))
syncider.add(syncibox)
syncider.set_tooltip_text("Get Help, Request Features, Chat With Developers")
syncider.connect("clicked",telegram)
#syncider.set_sensitive(False)
Squizbox.pack_end(syncider, False)
ctut = "Analytics"
if CUR in ["chr", "veh", "loc", "obj"]:
ctut = "Items"
elif CUR == "rnd":
ctut = "Story Editor"
def tutorials(w):
if CUR in ["chr", "veh", "loc", "obj"]:
oscalls.Open("https://open.lbry.com/@blender-organizer:5/BlenderOrganizerAssetsTutorialv4.87:e?r=5adqY5G5DyH8YxFL9UpT4ubYnWnaK2hN")
elif CUR == "rnd":
oscalls.Open("https://open.lbry.com/@blender-organizer:5/BlenderOrganizerStoryEditorTutorialv4.87:0?r=5adqY5G5DyH8YxFL9UpT4ubYnWnaK2hN")
else:
oscalls.Open("https://open.lbry.com/@blender-organizer:5/BlenderOrganizerAnalyticsTutorial4.87:6?r=5adqY5G5DyH8YxFL9UpT4ubYnWnaK2hN") # PUT
syncider = gtk.Button()
syncider.props.relief = gtk.RELIEF_NONE
syncibox = gtk.HBox(False)
synciico = gtk.Image()
synciico.set_from_file("py_data/icons/info.png")
syncibox.pack_start(synciico, False)
syncibox.pack_start(gtk.Label(ctut+" Help!"))
syncider.add(syncibox)
syncider.set_tooltip_text("Watch a tutorial on YouTube\nabout Blender-Organizer's "+ctut)
syncider.connect("clicked",tutorials)
#syncider.set_sensitive(False)
Squizbox.pack_end(syncider, False)
Squizbox.pack_end(gtk.VSeparator(), False)
# SYNC
#syncider = gtk.Button()
#syncider.props.relief = gtk.RELIEF_NONE
#syncibox = gtk.HBox(False)
#synciico = gtk.Image()
#synciico.set_from_file("py_data/icons/sync.png")
#syncibox.pack_start(synciico, False)
#syncibox.pack_start(gtk.Label(" Synchronize"))
#syncider.add(syncibox)
#syncider.set_tooltip_text("Synchronize between multiple machines")
#syncider.connect("clicked",chgCUR, "sync")
#syncider.set_sensitive(False)
#toppannelbox.pack_end(syncider, False)
# REPORT BUG
def Reportbug(w=False):
oscalls.Open("https://github.com/JYamihud/blender-organizer/issues")
Reportbugider = gtk.Button()
Reportbugider.props.relief = gtk.RELIEF_NONE
Reportbugibox = gtk.HBox(False)
Reportbugiico = gtk.Image()
Reportbugiico.set_from_file("py_data/icons/report_bug.png")
Reportbugibox.pack_start(Reportbugiico, False)
Reportbugibox.pack_start(gtk.Label(" Report BUG!"))
Reportbugider.add(Reportbugibox)
Reportbugider.set_tooltip_text("Go to report bug page.")
#Reportbugider.set_sensitive(False)
Reportbugider.connect("clicked", Reportbug)
Squizbox.pack_end(Reportbugider, False)
# Update
Updateider = gtk.Button()
Updateider.props.relief = gtk.RELIEF_NONE
Updateibox = gtk.HBox(False)
Updateiico = gtk.Image()
Updateiico.set_from_file("py_data/icons/update.png")
Updateibox.pack_start(Updateiico, False)
Updateibox.pack_start(gtk.Label(" Update"))
Updateider.add(Updateibox)
Updateider.set_tooltip_text("Check for updates")
#Updateider.set_sensitive(False)
Updateider.connect("clicked", update_window.main, os.getcwd())
Squizbox.pack_end(Updateider, False)
Squizbox.pack_end(gtk.VSeparator(), False)
secondarybuttonsOMGWTF()
#### DRAWING
drawbox = gtk.VBox(False)
def drawmain(w=None):
#global drawbox
#drawbox.destroy()
global mainbox
mainbox.destroy()
mainbox = gtk.VBox(False)
mainwin.add(mainbox)
buttons1()
drawmainbuttons()
secondarybuttonsOMGWTF()
drawbox = gtk.VBox(False)
mainbox.pack_start(drawbox, True)
if CUR in ["chr","obj","loc","veh"]:
assets.draw_assets(os.getcwd(), drawbox, mainwin, CUR, mainbox=mainbox)
if CUR == "stats":
analytics.draw_analytics(os.getcwd(), drawbox, mainwin, mainbox)
mainbox.show_all()
if CUR == "rnd":
story_editor.story(os.getcwd(), drawbox, mainwin, mainbox)
if CUR == "bldv":
blendver.draw_blendver(os.getcwd(), drawbox, mainwin)
drawmain()
# show the window
mainwin.show_all()
#run GTK
gtk.main()
os.system("notify-send -i "+os.getcwd()+"/py_data/icon.png Blender-Organizer :\(\ I\ will\ wait\ you\ back.")
#history.write(os.getcwd(), "/", "[Project Exited]")
print "\033[1;m"