~ubuntu-branches/ubuntu/utopic/blender/utopic-proposed

« back to all changes in this revision

Viewing changes to release/scripts/startup/bl_ui/properties_particle.py

  • Committer: Package Import Robot
  • Author(s): Matteo F. Vescovi
  • Date: 2012-04-28 12:11:12 UTC
  • mto: (14.1.6 experimental) (1.5.1)
  • mto: This revision was merged to the branch mainline in revision 34.
  • Revision ID: package-import@ubuntu.com-20120428121112-2zi0vp8b6vejda8i
Tags: upstream-2.63
ImportĀ upstreamĀ versionĀ 2.63

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
from bpy.types import Panel
22
22
from rna_prop_ui import PropertyPanel
23
23
 
24
 
from .properties_physics_common import (
 
24
from bl_ui.properties_physics_common import (
25
25
    point_cache_ui,
26
26
    effector_weights_ui,
27
27
    basic_force_field_settings_ui,
380
380
 
381
381
class PARTICLE_PT_rotation(ParticleButtonsPanel, Panel):
382
382
    bl_label = "Rotation"
 
383
    bl_options = {'DEFAULT_CLOSED'}
383
384
    COMPAT_ENGINES = {'BLENDER_RENDER'}
384
385
 
385
386
    @classmethod
394
395
        else:
395
396
            return False
396
397
 
 
398
    def draw_header(self, context):
 
399
        psys = context.particle_system
 
400
        if psys:
 
401
            part = psys.settings
 
402
        else:
 
403
            part = context.space_data.pin_id
 
404
 
 
405
        self.layout.prop(part, "use_rotations", text="")
 
406
 
397
407
    def draw(self, context):
398
408
        layout = self.layout
399
409
 
403
413
        else:
404
414
            part = context.space_data.pin_id
405
415
 
406
 
        layout.enabled = particle_panel_enabled(context, psys)
407
 
 
408
 
        layout.prop(part, "use_dynamic_rotation")
409
 
 
410
 
        if part.use_dynamic_rotation:
411
 
            layout.label(text="Initial Rotation Axis:")
412
 
        else:
413
 
            layout.label(text="Rotation Axis:")
 
416
        layout.enabled = particle_panel_enabled(context, psys) and part.use_rotations
 
417
 
 
418
        layout.label(text="Initial Orientation:")
414
419
 
415
420
        split = layout.split()
416
421
 
423
428
        col.prop(part, "phase_factor_random", text="Random", slider=True)
424
429
 
425
430
        if part.type != 'HAIR':
426
 
            col = layout.column()
427
 
            if part.use_dynamic_rotation:
428
 
                col.label(text="Initial Angular Velocity:")
429
 
            else:
430
 
                col.label(text="Angular Velocity:")
431
 
            sub = col.row(align=True)
432
 
            sub.prop(part, "angular_velocity_mode", text="")
433
 
            subsub = sub.column()
434
 
            subsub.active = part.angular_velocity_mode != 'NONE'
435
 
            subsub.prop(part, "angular_velocity_factor", text="")
 
431
            layout.label(text="Angular Velocity:")
 
432
 
 
433
            split = layout.split()
 
434
            col = split.column(align=True)
 
435
            col.prop(part, "angular_velocity_mode", text="")
 
436
            sub = col.column()
 
437
            sub.active = part.angular_velocity_mode != 'NONE'
 
438
            sub.prop(part, "angular_velocity_factor", text="")
 
439
 
 
440
            col = split.column()
 
441
            col.prop(part, "use_dynamic_rotation")
436
442
 
437
443
 
438
444
class PARTICLE_PT_physics(ParticleButtonsPanel, Panel):
1178
1184
        ob = context.object
1179
1185
        psys = context.particle_system
1180
1186
 
1181
 
        row = layout.row()
1182
 
        row.label(text="Vertex Group")
1183
 
        row.label(text="Negate")
1184
 
 
1185
 
        row = layout.row()
1186
 
        row.prop_search(psys, "vertex_group_density", ob, "vertex_groups", text="Density")
1187
 
        row.prop(psys, "invert_vertex_group_density", text="")
 
1187
        split = layout.split(percentage=0.85)
 
1188
 
 
1189
        col = split.column()
 
1190
        col.label(text="Vertex Group:")
 
1191
        col.prop_search(psys, "vertex_group_density", ob, "vertex_groups", text="Density")
 
1192
        col.prop_search(psys, "vertex_group_length", ob, "vertex_groups", text="Length")
 
1193
        col.prop_search(psys, "vertex_group_clump", ob, "vertex_groups", text="Clump")
 
1194
        col.prop_search(psys, "vertex_group_kink", ob, "vertex_groups", text="Kink")
 
1195
        col.prop_search(psys, "vertex_group_roughness_1", ob, "vertex_groups", text="Roughness 1")
 
1196
        col.prop_search(psys, "vertex_group_roughness_2", ob, "vertex_groups", text="Roughness 2")
 
1197
        col.prop_search(psys, "vertex_group_roughness_end", ob, "vertex_groups", text="Roughness End")
 
1198
 
 
1199
        col = split.column()
 
1200
        col.label(text="Negate:")
 
1201
        col.alignment = 'RIGHT'
 
1202
        col.prop(psys, "invert_vertex_group_density", text="")
 
1203
        col.prop(psys, "invert_vertex_group_length", text="")
 
1204
        col.prop(psys, "invert_vertex_group_clump", text="")
 
1205
        col.prop(psys, "invert_vertex_group_kink", text="")
 
1206
        col.prop(psys, "invert_vertex_group_roughness_1", text="")
 
1207
        col.prop(psys, "invert_vertex_group_roughness_2", text="")
 
1208
        col.prop(psys, "invert_vertex_group_roughness_end", text="")
1188
1209
 
1189
1210
        # Commented out vertex groups don't work and are still waiting for better implementation
1190
1211
        # row = layout.row()
1191
1212
        # row.prop_search(psys, "vertex_group_velocity", ob, "vertex_groups", text="Velocity")
1192
1213
        # row.prop(psys, "invert_vertex_group_velocity", text="")
1193
1214
 
1194
 
        row = layout.row()
1195
 
        row.prop_search(psys, "vertex_group_length", ob, "vertex_groups", text="Length")
1196
 
        row.prop(psys, "invert_vertex_group_length", text="")
1197
 
 
1198
 
        row = layout.row()
1199
 
        row.prop_search(psys, "vertex_group_clump", ob, "vertex_groups", text="Clump")
1200
 
        row.prop(psys, "invert_vertex_group_clump", text="")
1201
 
 
1202
 
        row = layout.row()
1203
 
        row.prop_search(psys, "vertex_group_kink", ob, "vertex_groups", text="Kink")
1204
 
        row.prop(psys, "invert_vertex_group_kink", text="")
1205
 
 
1206
 
        row = layout.row()
1207
 
        row.prop_search(psys, "vertex_group_roughness_1", ob, "vertex_groups", text="Roughness 1")
1208
 
        row.prop(psys, "invert_vertex_group_roughness_1", text="")
1209
 
 
1210
 
        row = layout.row()
1211
 
        row.prop_search(psys, "vertex_group_roughness_2", ob, "vertex_groups", text="Roughness 2")
1212
 
        row.prop(psys, "invert_vertex_group_roughness_2", text="")
1213
 
 
1214
 
        row = layout.row()
1215
 
        row.prop_search(psys, "vertex_group_roughness_end", ob, "vertex_groups", text="Roughness End")
1216
 
        row.prop(psys, "invert_vertex_group_roughness_end", text="")
1217
 
 
1218
1215
        # row = layout.row()
1219
1216
        # row.prop_search(psys, "vertex_group_size", ob, "vertex_groups", text="Size")
1220
1217
        # row.prop(psys, "invert_vertex_group_size", text="")