|
8 | 8 | if "bpy" in locals():
|
9 | 9 | import importlib
|
10 | 10 | importlib.reload(apply_all)
|
| 11 | + importlib.reload(apply_multi_user) |
11 | 12 | else:
|
12 | 13 | from . import apply_all
|
| 14 | + from . import apply_multi_user |
13 | 15 |
|
14 | 16 | import bpy
|
15 | 17 |
|
@@ -56,6 +58,14 @@ def main_instance(self, context):
|
56 | 58 | context.scene.filename_path = "scene"
|
57 | 59 | name = "scene"
|
58 | 60 |
|
| 61 | + |
| 62 | + |
| 63 | + |
| 64 | + # here we can apply modifier etc... |
| 65 | + |
| 66 | + |
| 67 | + |
| 68 | + |
59 | 69 | fn = os.path.join(basedir, name) + "_gpu.glb"
|
60 | 70 |
|
61 | 71 | wm = bpy.types.WindowManager
|
@@ -380,6 +390,27 @@ def execute(self, context):
|
380 | 390 | # raise the exception again
|
381 | 391 | raise e
|
382 | 392 |
|
| 393 | +class ApplyMultiUser(bpy.types.Operator): |
| 394 | + bl_idname = "object.apply_multi_user" |
| 395 | + bl_label = "Apply modifier to multi user" |
| 396 | + |
| 397 | + def execute(self, context): |
| 398 | + try: |
| 399 | + self.report( |
| 400 | + {"INFO"}, "----- ----- ----- Sougen Scripts ----- ----- -----") |
| 401 | + self.report({"INFO"}, "Applied modifier to multi user") |
| 402 | + bpy.context.window.cursor_set("WAIT") |
| 403 | + # loading = True |
| 404 | + apply_multi_user.applyModifierToMultiUser(self, context) |
| 405 | + bpy.context.window.cursor_set("DEFAULT") |
| 406 | + # loading = False |
| 407 | + return {"FINISHED"} |
| 408 | + except Exception as e: |
| 409 | + print("Something went wrong") |
| 410 | + self.report({"ERROR"}, "Something went wrong") |
| 411 | + # raise the exception again |
| 412 | + raise e |
| 413 | + |
383 | 414 | class BakeCamera(bpy.types.Operator):
|
384 | 415 | bl_idname = "object.simple_operator"
|
385 | 416 | bl_label = "Camera Bake Export"
|
@@ -585,10 +616,12 @@ def draw(self, context):
|
585 | 616 | icon="MOD_BUILD", depress=loading)
|
586 | 617 | layout.operator("object.curves_export",
|
587 | 618 | icon="FORCE_CURVE", depress=loading)
|
| 619 | + layout.operator("object.apply_multi_user", |
| 620 | + icon="EDITMODE_HLT", depress=loading) |
588 | 621 |
|
589 | 622 |
|
590 | 623 | blender_classes = [BakeCamera, SimpleGLTF, GLTF_Collider,
|
591 |
| - GLTF_PT_Panel, GLTF_Instance, Curves_Export] |
| 624 | + GLTF_PT_Panel, GLTF_Instance, Curves_Export, ApplyMultiUser] |
592 | 625 |
|
593 | 626 |
|
594 | 627 | def register():
|
|
0 commit comments