Merged changes in the trunk up to revision 53584.
[blender-staging.git] / release / scripts / startup / bl_ui / properties_game.py
1 # ##### BEGIN GPL LICENSE BLOCK #####
2 #
3 #  This program is free software; you can redistribute it and/or
4 #  modify it under the terms of the GNU General Public License
5 #  as published by the Free Software Foundation; either version 2
6 #  of the License, or (at your option) any later version.
7 #
8 #  This program is distributed in the hope that it will be useful,
9 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
10 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 #  GNU General Public License for more details.
12 #
13 #  You should have received a copy of the GNU General Public License
14 #  along with this program; if not, write to the Free Software Foundation,
15 #  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 #
17 # ##### END GPL LICENSE BLOCK #####
18
19 # <pep8 compliant>
20 import bpy
21 from bpy.types import Panel
22
23
24 class PhysicsButtonsPanel():
25     bl_space_type = 'PROPERTIES'
26     bl_region_type = 'WINDOW'
27     bl_context = "physics"
28
29
30 class PHYSICS_PT_game_physics(PhysicsButtonsPanel, Panel):
31     bl_label = "Physics"
32     COMPAT_ENGINES = {'BLENDER_GAME'}
33
34     @classmethod
35     def poll(cls, context):
36         ob = context.active_object
37         rd = context.scene.render
38         return ob and ob.game and (rd.engine in cls.COMPAT_ENGINES)
39
40     def draw(self, context):
41         layout = self.layout
42
43         ob = context.active_object
44         game = ob.game
45         soft = ob.game.soft_body
46
47         layout.prop(game, "physics_type")
48         layout.separator()
49
50         physics_type = game.physics_type
51
52         if physics_type == 'CHARACTER':
53             layout.prop(game, "use_actor")
54             layout.prop(ob, "hide_render", text="Invisible")  # out of place but useful
55             layout.prop(game, "step_height", slider=True)
56             layout.prop(game, "jump_speed")
57             layout.prop(game, "fall_speed")
58
59         elif physics_type in {'DYNAMIC', 'RIGID_BODY'}:
60             split = layout.split()
61
62             col = split.column()
63             col.prop(game, "use_actor")
64             col.prop(game, "use_ghost")
65             col.prop(ob, "hide_render", text="Invisible")  # out of place but useful
66
67             col = split.column()
68             col.prop(game, "use_material_physics_fh")
69             col.prop(game, "use_rotate_from_normal")
70             col.prop(game, "use_sleep")
71
72             layout.separator()
73
74             split = layout.split()
75
76             col = split.column()
77             col.label(text="Attributes:")
78             col.prop(game, "mass")
79             col.prop(game, "radius")
80             col.prop(game, "form_factor")
81
82             col = split.column()
83             sub = col.column()
84             sub.prop(game, "use_anisotropic_friction")
85             subsub = sub.column()
86             subsub.active = game.use_anisotropic_friction
87             subsub.prop(game, "friction_coefficients", text="", slider=True)
88
89             split = layout.split()
90
91             col = split.column()
92             col.label(text="Velocity:")
93             sub = col.column(align=True)
94             sub.prop(game, "velocity_min", text="Minimum")
95             sub.prop(game, "velocity_max", text="Maximum")
96
97             col = split.column()
98             col.label(text="Damping:")
99             sub = col.column(align=True)
100             sub.prop(game, "damping", text="Translation", slider=True)
101             sub.prop(game, "rotation_damping", text="Rotation", slider=True)
102
103             layout.separator()
104
105             split = layout.split()
106
107             col = split.column()
108             col.label(text="Lock Translation:")
109             col.prop(game, "lock_location_x", text="X")
110             col.prop(game, "lock_location_y", text="Y")
111             col.prop(game, "lock_location_z", text="Z")
112
113             col = split.column()
114             col.label(text="Lock Rotation:")
115             col.prop(game, "lock_rotation_x", text="X")
116             col.prop(game, "lock_rotation_y", text="Y")
117             col.prop(game, "lock_rotation_z", text="Z")
118
119         elif physics_type == 'SOFT_BODY':
120             col = layout.column()
121             col.prop(game, "use_actor")
122             col.prop(game, "use_ghost")
123             col.prop(ob, "hide_render", text="Invisible")
124
125             layout.separator()
126
127             split = layout.split()
128
129             col = split.column()
130             col.label(text="Attributes:")
131             col.prop(game, "mass")
132             # disabled in the code
133             # col.prop(soft, "weld_threshold")
134             col.prop(soft, "location_iterations")
135             col.prop(soft, "linear_stiffness", slider=True)
136             col.prop(soft, "dynamic_friction", slider=True)
137             col.prop(soft, "collision_margin", slider=True)
138             col.prop(soft, "use_bending_constraints", text="Bending Constraints")
139
140             col = split.column()
141             col.prop(soft, "use_shape_match")
142             sub = col.column()
143             sub.active = soft.use_shape_match
144             sub.prop(soft, "shape_threshold", slider=True)
145
146             col.separator()
147
148             col.label(text="Cluster Collision:")
149             col.prop(soft, "use_cluster_rigid_to_softbody")
150             col.prop(soft, "use_cluster_soft_to_softbody")
151             sub = col.column()
152             sub.active = (soft.use_cluster_rigid_to_softbody or soft.use_cluster_soft_to_softbody)
153             sub.prop(soft, "cluster_iterations", text="Iterations")
154
155         elif physics_type == 'STATIC':
156             col = layout.column()
157             col.prop(game, "use_actor")
158             col.prop(game, "use_ghost")
159             col.prop(ob, "hide_render", text="Invisible")
160
161             layout.separator()
162
163             split = layout.split()
164
165             col = split.column()
166             col.label(text="Attributes:")
167             col.prop(game, "radius")
168
169             col = split.column()
170             sub = col.column()
171             sub.prop(game, "use_anisotropic_friction")
172             subsub = sub.column()
173             subsub.active = game.use_anisotropic_friction
174             subsub.prop(game, "friction_coefficients", text="", slider=True)
175
176         elif physics_type == 'SENSOR':
177             col = layout.column()
178             col.prop(game, "use_actor", text="Detect Actors")
179             col.prop(ob, "hide_render", text="Invisible")
180
181         elif physics_type in {'INVISIBLE', 'NO_COLLISION', 'OCCLUDE'}:
182             layout.prop(ob, "hide_render", text="Invisible")
183
184         elif physics_type == 'NAVMESH':
185             layout.operator("mesh.navmesh_face_copy")
186             layout.operator("mesh.navmesh_face_add")
187
188             layout.separator()
189
190             layout.operator("mesh.navmesh_reset")
191             layout.operator("mesh.navmesh_clear")
192
193         if physics_type not in {'NO_COLLISION', 'OCCLUDE'}:
194             layout.separator()
195             split = layout.split()
196
197             col = split.column()
198             col.prop(game, "collision_group")
199             col = split.column()
200             col.prop(game, "collision_mask")
201
202 class PHYSICS_PT_game_collision_bounds(PhysicsButtonsPanel, Panel):
203     bl_label = "Collision Bounds"
204     COMPAT_ENGINES = {'BLENDER_GAME'}
205
206     @classmethod
207     def poll(cls, context):
208         game = context.object.game
209         rd = context.scene.render
210         return (game.physics_type in {'DYNAMIC', 'RIGID_BODY', 'SENSOR', 'SOFT_BODY', 'STATIC', 'CHARACTER'}) and (rd.engine in cls.COMPAT_ENGINES)
211
212     def draw_header(self, context):
213         game = context.active_object.game
214
215         self.layout.prop(game, "use_collision_bounds", text="")
216
217     def draw(self, context):
218         layout = self.layout
219
220         game = context.active_object.game
221
222         layout.active = game.use_collision_bounds
223         layout.prop(game, "collision_bounds_type", text="Bounds")
224
225         row = layout.row()
226         row.prop(game, "collision_margin", text="Margin", slider=True)
227         row.prop(game, "use_collision_compound", text="Compound")
228
229
230 class PHYSICS_PT_game_obstacles(PhysicsButtonsPanel, Panel):
231     bl_label = "Create Obstacle"
232     COMPAT_ENGINES = {'BLENDER_GAME'}
233
234     @classmethod
235     def poll(cls, context):
236         game = context.object.game
237         rd = context.scene.render
238         return (game.physics_type in {'DYNAMIC', 'RIGID_BODY', 'SENSOR', 'SOFT_BODY', 'STATIC'}) and (rd.engine in cls.COMPAT_ENGINES)
239
240     def draw_header(self, context):
241         game = context.active_object.game
242
243         self.layout.prop(game, "use_obstacle_create", text="")
244
245     def draw(self, context):
246         layout = self.layout
247
248         game = context.active_object.game
249
250         layout.active = game.use_obstacle_create
251
252         row = layout.row()
253         row.prop(game, "obstacle_radius", text="Radius")
254         row.label()
255
256
257 class RenderButtonsPanel():
258     bl_space_type = 'PROPERTIES'
259     bl_region_type = 'WINDOW'
260     bl_context = "render"
261
262     @classmethod
263     def poll(cls, context):
264         rd = context.scene.render
265         return (rd.engine in cls.COMPAT_ENGINES)
266
267
268 class RENDER_PT_embedded(RenderButtonsPanel, Panel):
269     bl_label = "Embedded Player"
270     COMPAT_ENGINES = {'BLENDER_GAME'}
271
272     def draw(self, context):
273         layout = self.layout
274
275         rd = context.scene.render
276
277         row = layout.row()
278         row.operator("view3d.game_start", text="Start")
279         row.label()
280         row = layout.row()
281         row.label(text="Resolution:")
282         row = layout.row(align=True)
283         row.prop(rd, "resolution_x", slider=False, text="X")
284         row.prop(rd, "resolution_y", slider=False, text="Y")
285
286
287 class RENDER_PT_game_player(RenderButtonsPanel, Panel):
288     bl_label = "Standalone Player"
289     COMPAT_ENGINES = {'BLENDER_GAME'}
290
291     def draw(self, context):
292         layout = self.layout
293
294         gs = context.scene.game_settings
295
296         row = layout.row()
297         row.operator("wm.blenderplayer_start", text="Start")
298         row.label()
299
300         row = layout.row()
301         row.label(text="Resolution:")
302         row = layout.row(align=True)
303         row.prop(gs, "resolution_x", slider=False, text="X")
304         row.prop(gs, "resolution_y", slider=False, text="Y")
305         row = layout.row()
306         col = row.column()
307         col.prop(gs, "show_fullscreen")
308         col = row.column()
309         col.prop(gs, "use_desktop")
310         col.active = gs.show_fullscreen
311
312         col = layout.column()
313         col.label(text="Quality:")
314         col.prop(gs, "samples")
315         col = layout.column(align=True)
316         col.prop(gs, "depth", text="Bit Depth", slider=False)
317         col.prop(gs, "frequency", text="Refresh Rate", slider=False)
318
319
320 class RENDER_PT_game_stereo(RenderButtonsPanel, Panel):
321     bl_label = "Stereo"
322     COMPAT_ENGINES = {'BLENDER_GAME'}
323
324     def draw(self, context):
325         layout = self.layout
326
327         gs = context.scene.game_settings
328         stereo_mode = gs.stereo
329
330         # stereo options:
331         layout.prop(gs, "stereo", expand=True)
332
333         # stereo:
334         if stereo_mode == 'STEREO':
335             layout.prop(gs, "stereo_mode")
336             layout.prop(gs, "stereo_eye_separation")
337
338         # dome:
339         elif stereo_mode == 'DOME':
340             layout.prop(gs, "dome_mode", text="Dome Type")
341
342             dome_type = gs.dome_mode
343
344             split = layout.split()
345
346             if dome_type in {'FISHEYE', 'TRUNCATED_REAR', 'TRUNCATED_FRONT'}:
347                 col = split.column()
348                 col.prop(gs, "dome_buffer_resolution", text="Resolution", slider=True)
349                 col.prop(gs, "dome_angle", slider=True)
350
351                 col = split.column()
352                 col.prop(gs, "dome_tessellation", text="Tessellation")
353                 col.prop(gs, "dome_tilt")
354
355             elif dome_type == 'PANORAM_SPH':
356                 col = split.column()
357                 col.prop(gs, "dome_buffer_resolution", text="Resolution", slider=True)
358
359                 col = split.column()
360                 col.prop(gs, "dome_tessellation", text="Tessellation")
361
362             else:  # cube map
363                 col = split.column()
364                 col.prop(gs, "dome_buffer_resolution", text="Resolution", slider=True)
365
366                 col = split.column()
367
368             layout.prop(gs, "dome_text")
369
370
371 class RENDER_PT_game_shading(RenderButtonsPanel, Panel):
372     bl_label = "Shading"
373     COMPAT_ENGINES = {'BLENDER_GAME'}
374
375     def draw(self, context):
376         layout = self.layout
377
378         gs = context.scene.game_settings
379
380         layout.prop(gs, "material_mode", expand=True)
381
382         if gs.material_mode == 'GLSL':
383             split = layout.split()
384
385             col = split.column()
386             col.prop(gs, "use_glsl_lights", text="Lights")
387             col.prop(gs, "use_glsl_shaders", text="Shaders")
388             col.prop(gs, "use_glsl_shadows", text="Shadows")
389             col.prop(gs, "use_glsl_color_management", text="Color Management")
390
391             col = split.column()
392             col.prop(gs, "use_glsl_ramps", text="Ramps")
393             col.prop(gs, "use_glsl_nodes", text="Nodes")
394             col.prop(gs, "use_glsl_extra_textures", text="Extra Textures")
395
396
397 class RENDER_PT_game_system(RenderButtonsPanel, Panel):
398     bl_label = "System"
399     COMPAT_ENGINES = {'BLENDER_GAME'}
400
401     def draw(self, context):
402         layout = self.layout
403
404         gs = context.scene.game_settings
405         col = layout.column()
406         row = col.row()
407         col = row.column()
408         col.prop(gs, "use_frame_rate")
409         col.prop(gs, "restrict_animation_updates")
410         col.prop(gs, "use_material_caching")
411         col = row.column()
412         col.prop(gs, "use_display_lists")
413         col.active = gs.raster_storage != 'VERTEX_BUFFER_OBJECT'
414                 
415         row = layout.row()
416         row.prop(gs, "raster_storage")
417         
418         row = layout.row()
419         row.label("Exit Key")
420         row.prop(gs, "exit_key", text="", event=True)
421
422
423 class RENDER_PT_game_display(RenderButtonsPanel, Panel):
424     bl_label = "Display"
425     COMPAT_ENGINES = {'BLENDER_GAME'}
426
427     def draw(self, context):
428         layout = self.layout
429
430         gs = context.scene.game_settings
431
432         layout.prop(context.scene.render, "fps", text="Animation Frame Rate", slider=False)
433
434         flow = layout.column_flow()
435         flow.prop(gs, "show_debug_properties", text="Debug Properties")
436         flow.prop(gs, "show_framerate_profile", text="Framerate and Profile")
437         flow.prop(gs, "show_physics_visualization", text="Physics Visualization")
438         flow.prop(gs, "use_deprecation_warnings")
439         flow.prop(gs, "show_mouse", text="Mouse Cursor")
440
441         col = layout.column()
442         col.label(text="Framing:")
443         col.row().prop(gs, "frame_type", expand=True)
444         if gs.frame_type == 'LETTERBOX':
445             col.prop(gs, "frame_color", text="")
446
447
448 class SceneButtonsPanel():
449     bl_space_type = 'PROPERTIES'
450     bl_region_type = 'WINDOW'
451     bl_context = "scene"
452
453
454 class SCENE_PT_game_navmesh(SceneButtonsPanel, Panel):
455     bl_label = "Navigation mesh"
456     bl_options = {'DEFAULT_CLOSED'}
457     COMPAT_ENGINES = {'BLENDER_GAME'}
458
459     @classmethod
460     def poll(cls, context):
461         scene = context.scene
462         return (scene and scene.render.engine in cls.COMPAT_ENGINES)
463
464     def draw(self, context):
465         layout = self.layout
466
467         rd = context.scene.game_settings.recast_data
468
469         layout.operator("mesh.navmesh_make", text="Build navigation mesh")
470
471         col = layout.column()
472         col.label(text="Rasterization:")
473         row = col.row()
474         row.prop(rd, "cell_size")
475         row.prop(rd, "cell_height")
476
477         col = layout.column()
478         col.label(text="Agent:")
479         split = col.split()
480
481         col = split.column()
482         col.prop(rd, "agent_height", text="Height")
483         col.prop(rd, "agent_radius", text="Radius")
484
485         col = split.column()
486         col.prop(rd, "slope_max")
487         col.prop(rd, "climb_max")
488
489         col = layout.column()
490         col.label(text="Region:")
491         row = col.row()
492         row.prop(rd, "region_min_size")
493         row.prop(rd, "region_merge_size")
494
495         col = layout.column()
496         col.label(text="Polygonization:")
497         split = col.split()
498
499         col = split.column()
500         col.prop(rd, "edge_max_len")
501         col.prop(rd, "edge_max_error")
502
503         split.prop(rd, "verts_per_poly")
504
505         col = layout.column()
506         col.label(text="Detail Mesh:")
507         row = col.row()
508         row.prop(rd, "sample_dist")
509         row.prop(rd, "sample_max_error")
510
511
512 class RENDER_PT_game_sound(RenderButtonsPanel, Panel):
513     bl_label = "Sound"
514     COMPAT_ENGINES = {'BLENDER_GAME'}
515
516     def draw(self, context):
517         layout = self.layout
518
519         scene = context.scene
520
521         layout.prop(scene, "audio_distance_model")
522
523         col = layout.column(align=True)
524         col.prop(scene, "audio_doppler_speed", text="Speed")
525         col.prop(scene, "audio_doppler_factor")
526
527
528 class WorldButtonsPanel():
529     bl_space_type = 'PROPERTIES'
530     bl_region_type = 'WINDOW'
531     bl_context = "world"
532
533
534 class WORLD_PT_game_context_world(WorldButtonsPanel, Panel):
535     bl_label = ""
536     bl_options = {'HIDE_HEADER'}
537     COMPAT_ENGINES = {'BLENDER_GAME'}
538
539     @classmethod
540     def poll(cls, context):
541         rd = context.scene.render
542         return (context.scene) and (rd.use_game_engine)
543
544     def draw(self, context):
545         layout = self.layout
546
547         scene = context.scene
548         world = context.world
549         space = context.space_data
550
551         split = layout.split(percentage=0.65)
552         if scene:
553             split.template_ID(scene, "world", new="world.new")
554         elif world:
555             split.template_ID(space, "pin_id")
556
557
558 class WORLD_PT_game_world(WorldButtonsPanel, Panel):
559     bl_label = "World"
560     COMPAT_ENGINES = {'BLENDER_GAME'}
561
562     @classmethod
563     def poll(cls, context):
564         scene = context.scene
565         return (scene.world and scene.render.engine in cls.COMPAT_ENGINES)
566
567     def draw(self, context):
568         layout = self.layout
569
570         world = context.world
571
572         row = layout.row()
573         row.column().prop(world, "horizon_color")
574         row.column().prop(world, "ambient_color")
575
576
577 class WORLD_PT_game_mist(WorldButtonsPanel, Panel):
578     bl_label = "Mist"
579     COMPAT_ENGINES = {'BLENDER_GAME'}
580
581     @classmethod
582     def poll(cls, context):
583         scene = context.scene
584         return (scene.world and scene.render.engine in cls.COMPAT_ENGINES)
585
586     def draw_header(self, context):
587         world = context.world
588
589         self.layout.prop(world.mist_settings, "use_mist", text="")
590
591     def draw(self, context):
592         layout = self.layout
593
594         world = context.world
595
596         layout.active = world.mist_settings.use_mist
597
598         layout.prop(world.mist_settings, "falloff")
599
600         row = layout.row(align=True)
601         row.prop(world.mist_settings, "start")
602         row.prop(world.mist_settings, "depth")
603
604         layout.prop(world.mist_settings, "intensity", text="Minimum Intensity")
605
606
607 class WORLD_PT_game_physics(WorldButtonsPanel, Panel):
608     bl_label = "Physics"
609     COMPAT_ENGINES = {'BLENDER_GAME'}
610
611     @classmethod
612     def poll(cls, context):
613         scene = context.scene
614         return (scene.world and scene.render.engine in cls.COMPAT_ENGINES)
615
616     def draw(self, context):
617         layout = self.layout
618
619         gs = context.scene.game_settings
620
621         layout.prop(gs, "physics_engine")
622         if gs.physics_engine != 'NONE':
623             layout.prop(gs, "physics_gravity", text="Gravity")
624
625             split = layout.split()
626
627             col = split.column()
628             col.label(text="Physics Steps:")
629             sub = col.column(align=True)
630             sub.prop(gs, "physics_step_max", text="Max")
631             sub.prop(gs, "physics_step_sub", text="Substeps")
632             col.prop(gs, "fps", text="FPS")
633
634             col = split.column()
635             col.label(text="Logic Steps:")
636             col.prop(gs, "logic_step_max", text="Max")
637
638             col = layout.column()
639             col.label(text="Physics Deactivation:")
640             sub = col.row(align=True)
641             sub.prop(gs, "deactivation_linear_threshold", text="Linear Threshold")
642             sub.prop(gs, "deactivation_angular_threshold", text="Angular Threshold")
643             sub = col.row()
644             sub.prop(gs, "deactivation_time", text="Time")
645
646             col = layout.column()
647             col.prop(gs, "use_occlusion_culling", text="Occlusion Culling")
648             sub = col.column()
649             sub.active = gs.use_occlusion_culling
650             sub.prop(gs, "occlusion_culling_resolution", text="Resolution")
651
652         else:
653             split = layout.split()
654
655             col = split.column()
656             col.label(text="Physics Steps:")
657             col.prop(gs, "fps", text="FPS")
658
659             col = split.column()
660             col.label(text="Logic Steps:")
661             col.prop(gs, "logic_step_max", text="Max")
662
663
664 class WORLD_PT_game_physics_obstacles(WorldButtonsPanel, Panel):
665     bl_label = "Obstacle simulation"
666     COMPAT_ENGINES = {'BLENDER_GAME'}
667
668     @classmethod
669     def poll(cls, context):
670         scene = context.scene
671         return (scene.world and scene.render.engine in cls.COMPAT_ENGINES)
672
673     def draw(self, context):
674         layout = self.layout
675
676         gs = context.scene.game_settings
677
678         layout.prop(gs, "obstacle_simulation", text="Type")
679         if gs.obstacle_simulation != 'NONE':
680             layout.prop(gs, "level_height")
681             layout.prop(gs, "show_obstacle_simulation")
682
683
684 class DataButtonsPanel():
685     bl_space_type = 'PROPERTIES'
686     bl_region_type = 'WINDOW'
687     bl_context = "data"
688
689
690 class DATA_PT_shadow_game(DataButtonsPanel, Panel):
691     bl_label = "Shadow"
692     COMPAT_ENGINES = {'BLENDER_GAME'}
693
694     @classmethod
695     def poll(cls, context):
696         COMPAT_LIGHTS = {'SPOT', 'SUN'}
697         lamp = context.lamp
698         engine = context.scene.render.engine
699         return (lamp and lamp.type in COMPAT_LIGHTS) and (engine in cls.COMPAT_ENGINES)
700
701     def draw_header(self, context):
702         lamp = context.lamp
703
704         self.layout.prop(lamp, "use_shadow", text="")
705
706     def draw(self, context):
707         layout = self.layout
708
709         lamp = context.lamp
710
711         layout.active = lamp.use_shadow
712
713         split = layout.split()
714
715         col = split.column()
716         col.prop(lamp, "shadow_color", text="")
717
718         col = split.column()
719         col.prop(lamp, "use_shadow_layer", text="This Layer Only")
720         col.prop(lamp, "use_only_shadow")
721
722         col = layout.column()
723         col.label("Buffer Type:")
724         col.prop(lamp, "ge_shadow_buffer_type", text="", toggle=True)
725         col.label("Quality:")
726         col = layout.column(align=True)
727         col.prop(lamp, "shadow_buffer_size", text="Size")
728         col.prop(lamp, "shadow_buffer_bias", text="Bias")
729         col.prop(lamp, "shadow_buffer_bleed_bias", text="Bleed Bias")
730
731         row = layout.row()
732         row.label("Clipping:")
733         row = layout.row(align=True)
734         row.prop(lamp, "shadow_buffer_clip_start", text="Clip Start")
735         row.prop(lamp, "shadow_buffer_clip_end", text="Clip End")
736
737         if lamp.type == 'SUN':
738             row = layout.row()
739             row.prop(lamp, "shadow_frustum_size", text="Frustum Size")
740
741
742 if __name__ == "__main__":  # only for live edit.
743     bpy.utils.register_module(__name__)