Changeset View
Changeset View
Standalone View
Standalone View
space_view3d_display_tools/fast_navigate.py
| Show All 37 Lines | |||||
| # Control how to display particles during fast navigate | # Control how to display particles during fast navigate | ||||
| def display_particles(mode, dis_particles): | def display_particles(mode, dis_particles): | ||||
| scene = bpy.context.scene.display_tools | scene = bpy.context.scene.display_tools | ||||
| for particles in bpy.data.particles: | for particles in bpy.data.particles: | ||||
| if scene.ShowParticles is False: | if scene.ShowParticles is False: | ||||
| particles.draw_method = 'NONE' | particles.display_method = 'NONE' | ||||
| else: | else: | ||||
| if particles.type == 'EMITTER': | if particles.type == 'EMITTER': | ||||
| particles.draw_method = 'DOT' | particles.display_method = 'DOT' | ||||
| particles.draw_percentage = 100 | particles.display_percentage = 100 | ||||
| else: | else: | ||||
| particles.draw_method = 'RENDER' | particles.display_method = 'RENDER' | ||||
| particles.draw_percentage = dis_particles | particles.display_percentage = dis_particles | ||||
| return dis_particles | return dis_particles | ||||
| # Fast Navigate operator | # Fast Navigate operator | ||||
| class FastNavigate(Operator): | class FastNavigate(Operator): | ||||
| bl_idname = "view3d.fast_navigate_operator" | bl_idname = "view3d.fast_navigate_operator" | ||||
| bl_label = "Fast Navigate" | bl_label = "Fast Navigate" | ||||
| ▲ Show 20 Lines • Show All 82 Lines • ▼ Show 20 Lines | def start_settings_store(self, context, store=False): | ||||
| shade = view.viewport_shade if view.type == 'VIEW_3D' else None | shade = view.viewport_shade if view.type == 'VIEW_3D' else None | ||||
| if store is False: | if store is False: | ||||
| if not shade: | if not shade: | ||||
| self.store_fail = True | self.store_fail = True | ||||
| else: | else: | ||||
| self.store_viewport_shade = shade | self.store_viewport_shade = shade | ||||
| for particle in bpy.data.particles: | for particle in bpy.data.particles: | ||||
| self.store_init_particles[particle.name] = \ | self.store_init_particles[particle.name] = \ | ||||
| [particle.draw_method, particle.draw_percentage] | [particle.display_method, particle.display_percentage] | ||||
| else: | else: | ||||
| if not shade: | if not shade: | ||||
| self.store_fail = True | self.store_fail = True | ||||
| else: | else: | ||||
| shade = self.store_viewport_shade or 'SOLID' | shade = self.store_viewport_shade or 'SOLID' | ||||
| for particle in bpy.data.particles: | for particle in bpy.data.particles: | ||||
| particle.draw_method = self.store_init_particles[particle.name][0] | particle.display_method = self.store_init_particles[particle.name][0] | ||||
| particle.draw_percentage = self.store_init_particles[particle.name][1] | particle.display_percentage = self.store_init_particles[particle.name][1] | ||||
| except: | except: | ||||
| self.store_fail = True | self.store_fail = True | ||||
| def get_screen_size(self, context, scene): | def get_screen_size(self, context, scene): | ||||
| if context.area.type == 'VIEW_3D': | if context.area.type == 'VIEW_3D': | ||||
| coord_x = context.area.x + scene.ScreenStart | coord_x = context.area.x + scene.ScreenStart | ||||
| coord_max_x = context.area.width - scene.ScreenEnd | coord_max_x = context.area.width - scene.ScreenEnd | ||||
| self.screen_width = [coord_x, coord_max_x] | self.screen_width = [coord_x, coord_max_x] | ||||
| ▲ Show 20 Lines • Show All 110 Lines • Show Last 20 Lines | |||||