Forum Replies Created

  • Sheikh Ghanee

    May 29, 2020 at 1:55 pm in reply to: get mouse cursor x and y location in script

    I did not consider of possibility of a display to start at non zero value.
    Thanks for pointing out.
    I should test it out.
    my code goes like this.

    var screenSizeX = 0;
    var screenSizeY = 0;
    var numArgs = $.screens.length;
    //Get combined resolution of the screen including multiple display setups
    for (i = 0; i < numArgs; i++) {
    var scnSize = $.screens[i];
    if (scnSize.right > screenSizeX) {
    screenSizeX = scnSize.right;
    }
    if (scnSize.bottom > screenSizeY) {
    screenSizeY = scnSize.bottom;
    }
    }

  • Sheikh Ghanee

    May 29, 2020 at 1:08 pm in reply to: get mouse cursor x and y location in script

    Hi,
    Thanks for your solution. I really appreciate it.
    I had to solve it in couple of days, so I already did it.
    This is quite literally the technique I used to solve the issue.

    Creating a dummy window, borderless with zero opacity did the trick.
    Yes, if we calculate the maximum resolution from the primary display, It works very well with multiple displays.
    I used multiple event listeners for this dummy window like “blur” and “mouse down” to dismiss the window, and to avoid bugs if the user moves the focus away from this dummy window.

    Waiting for the tool to be posted online so that I can share the code.
    But thanks again.

  • Sheikh Ghanee

    April 22, 2020 at 12:37 pm in reply to: Y position drives xScale and opacity

    You can use value remapping technique to achieve this effect.
    linear() – expression is helpful here.
    Assign the below expression to scale of the shadow layer and edit “Name of Trunk Layer” in the expression.

    yPosition = thisComp.layer("Name of Trunk Layer").transform.position[1];//Get the y position value of the trunk layer
    // Here we set minimum and maximum for the value receive from trunk layer
    inMin = 300;//the highest y position of trunk layer that affects the shadow layer
    inMax = 600;//lowest y position of trunk layer
    // Here we set minimum and maximum value for scale X of shadow layer
    outMin = 100;//when trunk goes far from shadow, scale X increases till its hits value 100
    outMax = 10;//when trunk comes near to shadow, scale X decreases till its hits value 10

    scaleXaxis = linear(yPosition,inMin,inMax,outMin,outMax);

    [scaleXaxis, 50]

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy