Skip to main content
TimSx
Inspiring
August 30, 2017
Question

AE error: This property has no maximum value

  • August 30, 2017
  • 1 reply
  • 1711 views

I am iterating through comp layers and layer properties and saving them in an object. I then call JSON.stringify() on the object created put in JSON valid format. Unfortunately I am getting an error:

Unable to execute script at line 230. After effects error: This property has no maximum value.

This is the function and line that the debugger points to. This is just a small piece of code.

function storeAVLayerData(avLayer){

    var layer = new Object();

    var layerTypeData = determineLayerType(avLayer);

    alert("layername: "+avLayer.name);

    layer.name = avLayer.name;

    layer.type = layerTypeData.type;

    layer.index = avLayer.index;

    layer.height = avLayer.height;

    layer.width = avLayer.width;

    layer.motionBlur = avLayer.motionBlur;

    layer.effectsActive = avLayer.effectsActive;

    layer.adjustmentLayer = avLayer.adjustmentLayer;

    layer.guideLayer = avLayer.guideLayer;

    layer.threeDLayer = avLayer.threeDLayer;

    layer.threeDPerChar = avLayer.threeDPerChar;

    layer.environmentLayer = avLayer.environmentLayer;

    layer.canSetCollapseTransformation = avLayer.canSetCollapseTransformation;

    layer.collapseTransformation = avLayer.collapseTransformation;

    layer.frameBlending = avLayer.frameBlending;

    layer.frameBlendingType = avLayer.frameBlendingType;

    layer.canSetTimeRemapEnabled = avLayer.canSetTimeRemapEnabled;

    layer.timeRemapEnabled = avLayer.timeRemapEnabled;

    layer.autoOrient = avLayer.autoOrient;

    layer.hasTrackMatte = avLayer.hasTrackMatte;

    layer.trackMatteType = avLayer.trackMatteType;

    layer.isTrackMatte = avLayer.isTrackMatte;

    layer.preserveTransparency = avLayer.preserveTransparency;

    layer.quality = avLayer.quality;

    layer.preserveTransparency = avLayer.preserveTransparency;

    layer.parent = avLayer.parent;

    layer.startTime = avLayer.startTime;

    layer.stretch = avLayer.stretch;

    layer.inPoint = avLayer.inPoint;

    layer.outPoint = avLayer.outPoint;

    layer.enabled = avLayer.enabled;

    layer.solo = avLayer.solo;

    layer.shy = avLayer.shy;

    layer.locked = avLayer.locked;

    return layer; //this is line 230

}

If I don't call the JSON.stringify() on an object, then the error is never thrown. This seems like an error in structure of object. This code works for a lot of projects, but some issue an error. How can I debug this and what does the error actually mean? It is kinda vague and google seems to be clueless.

1 reply

UQg
Legend
August 30, 2017

You get this kind off error when you query prop.maxValue while the property 'prop' does not have a max value

Examples:

theLayer.transform.postion.maxValue; // error

theLayer.transform.opacity.maxValue; // 100

so that querying maxValue should be preceeded by: if (prop.hasMax) (prop.maxValue etc...).

Therefore it is strange that your function generates this error, because layers dont have the maxValue attribute, only properties do.

Xavier.

TimSx
TimSxAuthor
Inspiring
August 30, 2017

Thanks for stopping by. Nowhere in my code I query for maxValue of anything. Strange indeed.

Tomas Sinkunas
Legend
August 30, 2017

Actually some long time ago I tried writing objectToSource() function that would parse AE properties. I remember I was getting those maxValue errors as well. Since this function wasn't that essential, I simply skipped maxValue. But guess what? Then AE complained about minValue. After ignoring minValue it complained about lightType, separationDimension, separationLeader

Anyways, if you want to take a look, there it is - AE Script: AE Object to Source — Bitbucket

That snippet would produce such result for a layer:

{

    "active": true,

    "audioEnabled": true,

    "autoOrient": 4212,

    "blendingMode": 5212,

    "canSetCollapseTransformation": true,

    "canSetEnabled": true,

    "containingComp": {

        "bgColor": [0.84705882352941, 0.25098039215686, 0.25098039215686],

        "duration": 1,

        "dynamicLinkGUID": "00000001-0000-0000-0000-000000000000",

        "frameDuration": 0.04,

        "frameRate": 25,

        "hasVideo": true,

        "height": 500,

        "id": 1,

        "label": 3,

        "layers": {},

        "markerProperty": {

            "active": true,

            "canVaryOverTime": true,

            "enabled": true,

            "matchName": "ADBE Marker",

            "name": "Marker",

            "parentProperty": {

                "active": true,

                "audioEnabled": true,

                "autoOrient": 4212,

                "blendingMode": 5212,

                "canSetEnabled": true,

                "collapseTransformation": true,

                "containingComp": {},

                "effectsActive": true,

                "enabled": true,

                "frameBlendingType": 4012,

                "hasVideo": true,

                "height": 500,

                "index": -2147483647,

                "isModified": true,

                "isNameSet": true,

                "label": 10,

                "matchName": "ADBE Vector Layer",

                "name": "Markers",

                "numProperties": 9,

                "outPoint": 29,

                "propertyType": 6213,

                "quality": 4614,

                "samplingQuality": 4812,

                "selectedProperties": [],

                "stretch": 100,

                "trackMatteType": 5012,

                "width": 500

            },

            "propertyDepth": 1,

            "propertyIndex": 1,

            "propertyType": 6212,

            "propertyValueType": 6420,

            "selectedKeys": [],

            "value": {

                "eventCuePoint": true

            }

        },

        "motionBlurAdaptiveSampleLimit": 128,

        "motionBlurSamplesPerFrame": 16,

        "name": "Comp 1",

        "numLayers": 1,

        "parentFolder": {

            "dynamicLinkGUID": "00000000-0000-0000-0000-000000000000",

            "items": {},

            "name": "Root",

            "numItems": 2,

            "typeName": "Folder"

        },

        "pixelAspect": 1,

        "renderer": "ADBE Advanced 3d",

        "renderers": ["ADBE Advanced 3d", "ADBE Ernst", "ADBE Picasso", "ADBE Standard 3d"],

        "resolutionFactor": [1, 1],

        "selected": true,

        "selectedLayers": [({})],

        "selectedProperties": [],

        "shutterAngle": 180,

        "shutterPhase": -90,

        "typeName": "Composition",

        "usedIn": [],

        "width": 500,

        "workAreaDuration": 1

    },

    "effectsActive": true,

    "enabled": true,

    "frameBlendingType": 4012,

    "hasVideo": true,

    "height": 500,

    "index": 1,

    "isModified": true,

    "isNameFromSource": true,

    "label": 1,

    "matchName": "ADBE AV Layer",

    "name": "Red Solid 1",

    "numProperties": 11,

    "outPoint": 1,

    "propertyType": 6213,

    "quality": 4614,

    "samplingQuality": 4812,

    "selected": true,

    "selectedProperties": [],

    "source": {

        "dynamicLinkGUID": "00000090-0000-0000-0000-000000000000",

        "frameDuration": 1,

        "hasVideo": true,

        "height": 500,

        "id": 144,

        "label": 1,

        "mainSource": {

            "alphaMode": 5412,

            "color": [0.77772700786591, 0.18244600296021, 0.33126199245453],

            "fieldSeparationType": 5613,

            "isStill": true,

            "loop": 1,

            "premulColor": [0, 0, 0],

            "removePulldown": 5813

        },

        "name": "Red Solid 1",

        "parentFolder": {

            "dynamicLinkGUID": "0000008f-0000-0000-0000-000000000000",

            "id": 143,

            "items": {},

            "name": "Solids",

            "numItems": 1,

            "parentFolder": {

                "dynamicLinkGUID": "00000000-0000-0000-0000-000000000000",

                "items": {},

                "name": "Root",

                "numItems": 2,

                "typeName": "Folder"

            },

            "typeName": "Folder"

        },

        "pixelAspect": 1,

        "typeName": "Footage",

        "usedIn": [({})],

        "width": 500

    },

    "stretch": 100,

    "trackMatteType": 5012,

    "width": 500

}