~ubuntu-branches/ubuntu/trusty/blender/trusty

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2013-03-06 12:08:47 UTC
  • mfrom: (1.5.1) (14.1.8 experimental)
  • Revision ID: package-import@ubuntu.com-20130306120847-frjfaryb2zrotwcg
Tags: 2.66a-1ubuntu1
* Resynchronize with Debian (LP: #1076930, #1089256, #1052743, #999024,
  #1122888, #1147084)
* debian/control:
  - Lower build-depends on libavcodec-dev since we're not
    doing the libav9 transition in Ubuntu yet

Show diffs side-by-side

added added

removed removed

Lines of Context:
119
119
        bone = context.bone
120
120
        pchan = ob.pose.bones[bone.name]
121
121
 
122
 
        row = layout.row()
123
 
        col = row.column()
124
 
        col.prop(pchan, "lock_location")
125
 
        col.active = not (bone.parent and bone.use_connect)
126
 
 
127
 
        col = row.column()
 
122
        split = layout.split(percentage=0.1)
 
123
 
 
124
        col = split.column(align=True)
 
125
        col.label(text="")
 
126
        col.label(text="X:")
 
127
        col.label(text="Y:")
 
128
        col.label(text="Z:")
 
129
 
 
130
        col = split.row()
 
131
        sub = col.row()
 
132
        sub.active = not (bone.parent and bone.use_connect)
 
133
        sub.column().prop(pchan, "lock_location", text="Location")
 
134
        col.column().prop(pchan, "lock_rotation", text="Rotation")
 
135
        col.column().prop(pchan, "lock_scale", text="Scale")
 
136
 
128
137
        if pchan.rotation_mode in {'QUATERNION', 'AXIS_ANGLE'}:
129
 
            col.prop(pchan, "lock_rotations_4d", text="Lock Rotation")
130
 
            if pchan.lock_rotations_4d:
131
 
                col.prop(pchan, "lock_rotation_w", text="W")
132
 
            col.prop(pchan, "lock_rotation", text="")
133
 
        else:
134
 
            col.prop(pchan, "lock_rotation", text="Rotation")
 
138
            row = layout.row()
 
139
            row.prop(pchan, "lock_rotations_4d", text="Lock Rotation")
135
140
 
136
 
        row.column().prop(pchan, "lock_scale")
 
141
            sub = row.row()
 
142
            sub.active = pchan.lock_rotations_4d
 
143
            sub.prop(pchan, "lock_rotation_w", text="W")
137
144
 
138
145
 
139
146
class BONE_PT_relations(BoneButtonsPanel, Panel):
163
170
        if ob and pchan:
164
171
            col.label(text="Bone Group:")
165
172
            col.prop_search(pchan, "bone_group", ob.pose, "bone_groups", text="")
 
173
            col.label(text="Object Children:")
 
174
            col.prop(bone, "use_relative_parent")
166
175
 
167
176
        col = split.column()
168
177
        col.label(text="Parent:")
174
183
        sub = col.column()
175
184
        sub.active = (bone.parent is not None)
176
185
        sub.prop(bone, "use_connect")
177
 
        sub.prop(bone, "use_inherit_rotation", text="Inherit Rotation")
178
 
        sub.prop(bone, "use_inherit_scale", text="Inherit Scale")
 
186
        sub.prop(bone, "use_inherit_rotation")
 
187
        sub.prop(bone, "use_inherit_scale")
179
188
        sub = col.column()
180
189
        sub.active = (not bone.parent or not bone.use_connect)
181
 
        sub.prop(bone, "use_local_location", text="Local Location")
 
190
        sub.prop(bone, "use_local_location")
182
191
 
183
192
 
184
193
class BONE_PT_display(BoneButtonsPanel, Panel):
237
246
        pchan = ob.pose.bones[bone.name]
238
247
 
239
248
        row = layout.row()
240
 
        row.prop(ob.pose, "ik_solver")
 
249
 
 
250
        active = pchan.is_in_ik_chain
241
251
 
242
252
        split = layout.split(percentage=0.25)
243
253
        split.prop(pchan, "lock_ik_x", icon='LOCKED' if pchan.lock_ik_x else 'UNLOCKED', text="X")
244
 
        split.active = pchan.is_in_ik_chain
 
254
        split.active = active
245
255
        row = split.row()
246
256
        row.prop(pchan, "ik_stiffness_x", text="Stiffness", slider=True)
247
 
        row.active = pchan.lock_ik_x == False and pchan.is_in_ik_chain
 
257
        row.active = pchan.lock_ik_x is False and active
248
258
 
249
259
        split = layout.split(percentage=0.25)
250
260
        sub = split.row()
251
261
 
252
262
        sub.prop(pchan, "use_ik_limit_x", text="Limit")
253
 
        sub.active = pchan.lock_ik_x == False and pchan.is_in_ik_chain
 
263
        sub.active = pchan.lock_ik_x is False and active
254
264
        sub = split.row(align=True)
255
265
        sub.prop(pchan, "ik_min_x", text="")
256
266
        sub.prop(pchan, "ik_max_x", text="")
257
 
        sub.active = pchan.lock_ik_x == False and pchan.use_ik_limit_x and pchan.is_in_ik_chain
 
267
        sub.active = pchan.lock_ik_x is False and pchan.use_ik_limit_x and active
258
268
 
259
269
        split = layout.split(percentage=0.25)
260
270
        split.prop(pchan, "lock_ik_y", icon='LOCKED' if pchan.lock_ik_y else 'UNLOCKED', text="Y")
261
 
        split.active = pchan.is_in_ik_chain
 
271
        split.active = active
262
272
        row = split.row()
263
273
        row.prop(pchan, "ik_stiffness_y", text="Stiffness", slider=True)
264
 
        row.active = pchan.lock_ik_y == False and pchan.is_in_ik_chain
 
274
        row.active = pchan.lock_ik_y is False and active
265
275
 
266
276
        split = layout.split(percentage=0.25)
267
277
        sub = split.row()
268
278
 
269
279
        sub.prop(pchan, "use_ik_limit_y", text="Limit")
270
 
        sub.active = pchan.lock_ik_y == False and pchan.is_in_ik_chain
 
280
        sub.active = pchan.lock_ik_y is False and active
271
281
 
272
282
        sub = split.row(align=True)
273
283
        sub.prop(pchan, "ik_min_y", text="")
274
284
        sub.prop(pchan, "ik_max_y", text="")
275
 
        sub.active = pchan.lock_ik_y == False and pchan.use_ik_limit_y and pchan.is_in_ik_chain
 
285
        sub.active = pchan.lock_ik_y is False and pchan.use_ik_limit_y and active
276
286
 
277
287
        split = layout.split(percentage=0.25)
278
288
        split.prop(pchan, "lock_ik_z", icon='LOCKED' if pchan.lock_ik_z else 'UNLOCKED', text="Z")
279
 
        split.active = pchan.is_in_ik_chain
 
289
        split.active = active
280
290
        sub = split.row()
281
291
        sub.prop(pchan, "ik_stiffness_z", text="Stiffness", slider=True)
282
 
        sub.active = pchan.lock_ik_z == False and pchan.is_in_ik_chain
 
292
        sub.active = pchan.lock_ik_z is False and active
283
293
 
284
294
        split = layout.split(percentage=0.25)
285
295
        sub = split.row()
286
296
 
287
297
        sub.prop(pchan, "use_ik_limit_z", text="Limit")
288
 
        sub.active = pchan.lock_ik_z == False and pchan.is_in_ik_chain
 
298
        sub.active = pchan.lock_ik_z is False and active
289
299
        sub = split.row(align=True)
290
300
        sub.prop(pchan, "ik_min_z", text="")
291
301
        sub.prop(pchan, "ik_max_z", text="")
292
 
        sub.active = pchan.lock_ik_z == False and pchan.use_ik_limit_z and pchan.is_in_ik_chain
 
302
        sub.active = pchan.lock_ik_z is False and pchan.use_ik_limit_z and active
293
303
 
294
304
        split = layout.split(percentage=0.25)
295
305
        split.label(text="Stretch:")
296
306
        sub = split.row()
297
307
        sub.prop(pchan, "ik_stretch", text="", slider=True)
298
 
        sub.active = pchan.is_in_ik_chain
 
308
        sub.active = active
299
309
 
300
310
        if ob.pose.ik_solver == 'ITASC':
301
311
            split = layout.split()
302
312
            col = split.column()
303
313
            col.prop(pchan, "use_ik_rotation_control", text="Control Rotation")
304
 
            col.active = pchan.is_in_ik_chain
 
314
            col.active = active
305
315
            col = split.column()
306
316
            col.prop(pchan, "ik_rotation_weight", text="Weight", slider=True)
307
 
            col.active = pchan.is_in_ik_chain
 
317
            col.active = active
308
318
            # not supported yet
309
319
            #row = layout.row()
310
320
            #row.prop(pchan, "use_ik_linear_control", text="Joint Size")
356
366
        sub.prop(bone, "bbone_in", text="Ease In")
357
367
        sub.prop(bone, "bbone_out", text="Ease Out")
358
368
 
359
 
        col.label(text="Offset:")
360
 
        col.prop(bone, "use_cyclic_offset")
361
 
 
362
369
 
363
370
class BONE_PT_custom_props(BoneButtonsPanel, PropertyPanel, Panel):
364
371
    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'}