Advertisement
Guest User

Untitled

a guest
Mar 26th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. J:> "X:exiftool(-k).exe" -t -file -scene -f J:randompath
  2.  
  3. ======== J:/random/some_i.png
  4. File J:randomrandom_blend.blend
  5. Scene Donut.001
  6.  
  7. import bpy
  8. import random
  9. import datetime
  10. import re
  11. import math
  12. import os
  13. from pathlib import Path
  14.  
  15. def render_dir_info(context):
  16. #single context only
  17. keywords = "Dog Bone Wag Bark"
  18. rating = 0
  19. # ignoring render.stamp_note_text
  20. slist = [str(datetime.datetime.today()),
  21. "Blender File Name :" + bpy.data.filepath,
  22. "Blender Scene Name :"+bpy.context.scene.name,
  23. "Blender Render File Path : "+bpy.path.abspath(bpy.context.scene.render.filepath),
  24. "Rating : "+str(rating),
  25. "Keywords : "+keywords
  26. ]
  27. for sbq in slist :
  28. print(sbq)
  29. f1 = bpy.path.abspath(bpy.context.scene.render.filepath)
  30. path1, discard = os.path.split(f1)
  31. print(">>>", f1, path1, discard)
  32. filename_bq = "image_info.txt"
  33. dirname_bq = "image_info"
  34. pathdir = os.path.join(path1, dirname_bq)
  35. print(pathdir)
  36. pathdir_x = Path(pathdir)
  37. pathdir_x.mkdir(exist_ok = True)
  38. fileb = False;
  39. if pathdir_x.is_dir():
  40. pathfile = os.path.join(pathdir, filename_bq)
  41. print(pathfile)
  42. fp = Path(pathfile)
  43. with open(pathfile, mode='at') as fd:
  44. for sbq in slist :
  45. print(sbq, file=fd)
  46. #fd.write(sbq)
  47. fileb = True;
  48. fs = "File Written" if fileb else "Failed"
  49. print(fs)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement