tobi-be / BlenderEdmExporter

Blender EDM Exporter please read the readme

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use of LIMIT_ROTATION and LIMIT_LOCATION constraint cause bake action to fail

Copprhead opened this issue · comments

For both constraints, the "target" property is checked to exist. As these constraint types don't have that property the script aborts.

or c.type=='LIMIT_ROTATION') and not c.mute:

or c.type=='LIMIT_LOCATION'

Fixed it in edmbakeaction.py by adding dedicated case for these constraints that doesn't check the target property:


            if c.type=='LIMIT_ROTATION' and not c.mute:
                rotationkeyframedBones[b.name]=1    

            if (c.type=='TRACK_TO' 
                or c.type=='LOCKED_TRACK' 
                or c.type=='DAMPED_TRACK' 
                or c.type=='TRANSFORM' 
                or c.type=='COPY_TRANSFORMS' 
                #or c.type=='LIMIT_ROTATION'
                or c.type=='COPY_ROTATION') and not c.mute:
                if c.target!=None:
                    if c.target.type=='ARMATURE':
                        if c.subtarget!=None:
                            rotationkeyframedBones[b.name]=1
                    else:
                        rotationkeyframedBones[b.name]=1
            
            if c.type=='LIMIT_LOCATION' and not c.mute:
                locationkeyframedBones[b.name]=1

            if (c.type=='COPY_LOCATION' 
                or c.type=='TRANSFORM' 
                #or c.type=='LIMIT_LOCATION'
                or c.type=='COPY_TRANSFORMS'
                or c.type=='LIMIT_DISTANCE') and not c.mute:
                if c.target!=None:
                    if c.target.type=='ARMATURE':
                        if c.subtarget!=None:
                            locationkeyframedBones[b.name]=1
                    else:
                        locationkeyframedBones[b.name]=1
            

Thank you