Advertisement
Guest User

Untitled

a guest
Jul 18th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. def ShowMessageBox(message = "", title = "Message Box", icon = 'INFO'):
  2. def drawinfo(self, context):
  3. self.layout.label(text = message)
  4. bpy.context.window_manager.popup_menu(drawinfo, title = title, icon = icon)
  5.  
  6. class WIF_OP_ImportDazData(bpy.types.Operator, buttons.SingleFile, buttons.JsonFile, ImportHelper):
  7. bl_idname = "import_js.dazdata"
  8. bl_label = "Import Json"
  9. bl_description = "import rig data to adjust daz bones"
  10. bl_options = {'UNDO'}
  11.  
  12. filter_glob: StringProperty(
  13. default='*.json;*.txt',
  14. options={'HIDDEN'},
  15. )
  16.  
  17. def execute(self, context):
  18. filename, extension = os.path.splitext(self.filepath)
  19. if extension == '.json':
  20. rigdata = read_json(context, self.filepath)
  21. rigs = bpy.context.selected_objects
  22. set_custom_props(rigs, rigdata)
  23. else:
  24. print("Select json please!")
  25. ShowMessageBox("Select JSON please!!", "fail load", "INFO")
  26. return {'FINISHED'}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement