diff options
Diffstat (limited to 'release/scripts/ui/properties_physics_common.py')
-rw-r--r-- | release/scripts/ui/properties_physics_common.py | 65 |
1 files changed, 25 insertions, 40 deletions
diff --git a/release/scripts/ui/properties_physics_common.py b/release/scripts/ui/properties_physics_common.py index be8972e4fe6..fb9f2f981ae 100644 --- a/release/scripts/ui/properties_physics_common.py +++ b/release/scripts/ui/properties_physics_common.py @@ -20,28 +20,25 @@ import bpy -narrowui = bpy.context.user_preferences.view.properties_width_check - #cachetype can be 'PSYS' 'HAIR' 'SMOKE' etc def point_cache_ui(self, context, cache, enabled, cachetype): layout = self.layout - wide_ui = context.region.width > narrowui layout.set_context_pointer("point_cache", cache) row = layout.row() - row.template_list(cache, "point_cache_list", cache, "active_point_cache_index", rows=2) + row.template_list(cache, "point_caches", cache, "active_point_cache_index", rows=2) col = row.column(align=True) col.operator("ptcache.add", icon='ZOOMIN', text="") col.operator("ptcache.remove", icon='ZOOMOUT', text="") row = layout.row() if cachetype in ('PSYS', 'HAIR', 'SMOKE'): - row.prop(cache, "external") + row.prop(cache, "use_external") - if cache.external: + if cache.use_external: split = layout.split(percentage=0.80) split.prop(cache, "name", text="File Name") split.prop(cache, "index", text="") @@ -64,19 +61,18 @@ def point_cache_ui(self, context, cache, enabled, cachetype): col.prop(cache, "frame_start") col.prop(cache, "frame_end") if cachetype != 'SMOKE': - col.prop(cache, "step") + col.prop(cache, "frame_step") - if wide_ui: - col = split.column() + col = split.column() if cachetype != 'SMOKE': sub = col.column() sub.enabled = enabled - sub.prop(cache, "quick_cache") + sub.prop(cache, "use_quick_cache") sub = col.column() - sub.enabled = bpy.data.file_is_saved - sub.prop(cache, "disk_cache") + sub.enabled = (not bpy.data.is_dirty) + sub.prop(cache, "use_disk_cache") col.label(text=cache.info) sub = col.column() @@ -88,13 +84,13 @@ def point_cache_ui(self, context, cache, enabled, cachetype): col = split.column() - if cache.baked == True: + if cache.is_baked == True: col.operator("ptcache.free_bake", text="Free Bake") else: col.operator("ptcache.bake", text="Bake").bake = True sub = col.row() - sub.enabled = (cache.frames_skipped or cache.outdated) and enabled + sub.enabled = (cache.frames_skipped or cache.is_outdated) and enabled sub.operator("ptcache.bake", text="Calculate To Frame").bake = False sub = col.column() @@ -102,8 +98,7 @@ def point_cache_ui(self, context, cache, enabled, cachetype): sub.operator("ptcache.bake_from_cache", text="Current Cache to Bake") - if wide_ui: - col = split.column() + col = split.column() col.operator("ptcache.bake_all", text="Bake All Dynamics").bake = True col.operator("ptcache.free_bake_all", text="Free All Bakes") col.operator("ptcache.bake_all", text="Update All To Frame").bake = False @@ -112,7 +107,6 @@ def point_cache_ui(self, context, cache, enabled, cachetype): def effector_weights_ui(self, context, weights): layout = self.layout - wide_ui = context.region.width > narrowui layout.prop(weights, "group") @@ -121,8 +115,7 @@ def effector_weights_ui(self, context, weights): col = split.column() col.prop(weights, "gravity", slider=True) - if wide_ui: - col = split.column() + col = split.column() col.prop(weights, "all", slider=True) layout.separator() @@ -134,11 +127,10 @@ def effector_weights_ui(self, context, weights): col.prop(weights, "vortex", slider=True) col.prop(weights, "magnetic", slider=True) col.prop(weights, "wind", slider=True) - col.prop(weights, "curveguide", slider=True) + col.prop(weights, "curve_guide", slider=True) col.prop(weights, "texture", slider=True) - if wide_ui: - col = split.column() + col = split.column() col.prop(weights, "harmonic", slider=True) col.prop(weights, "charge", slider=True) col.prop(weights, "lennardjones", slider=True) @@ -150,7 +142,6 @@ def effector_weights_ui(self, context, weights): def basic_force_field_settings_ui(self, context, field): layout = self.layout - wide_ui = context.region.width > narrowui split = layout.split() @@ -177,37 +168,32 @@ def basic_force_field_settings_ui(self, context, field): else: col.prop(field, "flow") - if wide_ui: - col = split.column() + col = split.column() col.prop(field, "noise") col.prop(field, "seed") if field.type == 'TURBULENCE': - col.prop(field, "global_coordinates", text="Global") + col.prop(field, "use_global_coords", text="Global") elif field.type == 'HARMONIC': - col.prop(field, "multiple_springs") + col.prop(field, "use_multiple_springs") split = layout.split() col = split.column() col.label(text="Effect point:") - col.prop(field, "do_location") - col.prop(field, "do_rotation") + col.prop(field, "apply_to_location") + col.prop(field, "apply_to_rotation") - if wide_ui: - col = split.column() + col = split.column() col.label(text="Collision:") - col.prop(field, "do_absorption") + col.prop(field, "use_absorption") def basic_force_field_falloff_ui(self, context, field): layout = self.layout - wide_ui = context.region.width > narrowui # XXX: This doesn't update for some reason. - #if wide_ui: - # split = layout.split() - #else: + #split = layout.split() split = layout.split(percentage=0.35) if not field or field.type == 'NONE': @@ -218,17 +204,16 @@ def basic_force_field_falloff_ui(self, context, field): col.prop(field, "use_min_distance", text="Use Minimum") col.prop(field, "use_max_distance", text="Use Maximum") - if wide_ui: - col = split.column() + col = split.column() col.prop(field, "falloff_power", text="Power") sub = col.column() sub.active = field.use_min_distance - sub.prop(field, "minimum_distance", text="Distance") + sub.prop(field, "distance_min", text="Distance") sub = col.column() sub.active = field.use_max_distance - sub.prop(field, "maximum_distance", text="Distance") + sub.prop(field, "distance_max", text="Distance") def register(): |