Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- J:> "X:exiftool(-k).exe" -t -file -scene -f J:randompath
- ======== J:/random/some_i.png
- File J:randomrandom_blend.blend
- Scene Donut.001
- import bpy
- import random
- import datetime
- import re
- import math
- import os
- from pathlib import Path
- def render_dir_info(context):
- #single context only
- keywords = "Dog Bone Wag Bark"
- rating = 0
- # ignoring render.stamp_note_text
- slist = [str(datetime.datetime.today()),
- "Blender File Name :" + bpy.data.filepath,
- "Blender Scene Name :"+bpy.context.scene.name,
- "Blender Render File Path : "+bpy.path.abspath(bpy.context.scene.render.filepath),
- "Rating : "+str(rating),
- "Keywords : "+keywords
- ]
- for sbq in slist :
- print(sbq)
- f1 = bpy.path.abspath(bpy.context.scene.render.filepath)
- path1, discard = os.path.split(f1)
- print(">>>", f1, path1, discard)
- filename_bq = "image_info.txt"
- dirname_bq = "image_info"
- pathdir = os.path.join(path1, dirname_bq)
- print(pathdir)
- pathdir_x = Path(pathdir)
- pathdir_x.mkdir(exist_ok = True)
- fileb = False;
- if pathdir_x.is_dir():
- pathfile = os.path.join(pathdir, filename_bq)
- print(pathfile)
- fp = Path(pathfile)
- with open(pathfile, mode='at') as fd:
- for sbq in slist :
- print(sbq, file=fd)
- #fd.write(sbq)
- fileb = True;
- fs = "File Written" if fileb else "Failed"
- print(fs)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement