~siretart/ubuntu/utopic/blender/libav10

« back to all changes in this revision

Viewing changes to release/scripts/addons/io_scene_ms3d/ms3d_export.py

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2014-02-19 11:24:23 UTC
  • mfrom: (14.2.23 sid)
  • Revision ID: package-import@ubuntu.com-20140219112423-rkmaz2m7ha06d4tk
Tags: 2.69-3ubuntu1
* Merge with Debian; remaining changes:
  - Configure without OpenImageIO on armhf, as it is not available on
    Ubuntu.

Show diffs side-by-side

added added

removed removed

Lines of Context:
574
574
            blender_bones = None
575
575
            blender_action = None
576
576
            blender_nla_tracks = None
577
 
            for blender_modifier in blender_mesh_object.modifiers:
578
 
                if blender_modifier.type == 'ARMATURE' \
579
 
                        and blender_modifier.object.pose:
580
 
                    blender_bones = blender_modifier.object.data.bones
581
 
                    blender_pose_bones = blender_modifier.object.pose.bones
582
 
                    if blender_modifier.object.animation_data:
583
 
                        blender_action = \
584
 
                                blender_modifier.object.animation_data.action
585
 
                        blender_nla_tracks = \
586
 
                                blender_modifier.object.animation_data.nla_tracks
587
 
 
588
 
                    # apply transform
589
 
                    if self.options_apply_transform:
590
 
                        matrix_transform = blender_modifier.object.matrix_basis
591
 
                    else:
592
 
                        matrix_transform = 1
593
 
 
594
 
                    break
595
 
 
 
577
 
 
578
            # note: only one armature modifier/parent will be handled.
 
579
            #   if the parent is an armature, it will be handled irrespective
 
580
            #   of existence of any armature modifier
 
581
 
 
582
            # question: maybe it is better to handle
 
583
            #   all existing armature sources (parent / modifier)
 
584
            #   as a merged animation...
 
585
            #   what is best practice in case of multiple animation sources?
 
586
 
 
587
            # take parent to account if it is an armature
 
588
            if blender_mesh_object.parent and \
 
589
                    blender_mesh_object.parent_type == 'ARMATURE' and \
 
590
                    blender_mesh_object.parent.pose:
 
591
                blender_bones = blender_mesh_object.parent.data.bones
 
592
                blender_pose_bones = blender_mesh_object.parent.pose.bones
 
593
                if blender_mesh_object.parent.animation_data:
 
594
                    blender_action = \
 
595
                            blender_mesh_object.parent.animation_data.action
 
596
                    blender_nla_tracks = \
 
597
                            blender_mesh_object.parent.animation_data.nla_tracks
 
598
 
 
599
                # apply transform
 
600
                if self.options_apply_transform:
 
601
                    matrix_transform = blender_mesh_object.parent.matrix_basis
 
602
                else:
 
603
                    matrix_transform = 1
 
604
 
 
605
            # search for animation modifier
 
606
            else:
 
607
                for blender_modifier in blender_mesh_object.modifiers:
 
608
                    if blender_modifier.type == 'ARMATURE' \
 
609
                            and blender_modifier.object.pose:
 
610
                        blender_bones = blender_modifier.object.data.bones
 
611
                        blender_pose_bones = blender_modifier.object.pose.bones
 
612
                        if blender_modifier.object.animation_data:
 
613
                            blender_action = \
 
614
                                    blender_modifier.object.animation_data.action
 
615
                            blender_nla_tracks = \
 
616
                                    blender_modifier.object.animation_data.nla_tracks
 
617
 
 
618
                        # apply transform
 
619
                        if self.options_apply_transform:
 
620
                            matrix_transform = blender_modifier.object.matrix_basis
 
621
                        else:
 
622
                            matrix_transform = 1
 
623
 
 
624
                        break
 
625
 
 
626
            # skip animation/bone handling, if no animation data is available
596
627
            if blender_bones is None \
597
628
                    and (blender_action is None and blender_nla_tracks is None):
598
629
                continue