• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Get mouse position on click in comp preview

Explorer ,
Jul 07, 2022 Jul 07, 2022

Copy link to clipboard

Copied

I want to get the position of the mouse when the user clicks in the comp window. I can get the mouse position using OS calls, but I want the relative position, exactly like PF_Param_POINT does it when you press that target button next to the parameter value.

 

I though about geting the size and position of the comp and then calculate the mouse position using the OS mouse calls, but I don't know how to get the position and size of the comp.

 

Another option would be to add a hidden PF_Param_POINT, and force the activation of the pick tool from the parameter, but I didn't find a way to activate it without user input.

 

Any ideas?

TOPICS
SDK

Views

541

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jul 07, 2022 Jul 07, 2022

take a look at the "CCU" SDK sample project. it shows hot to get the mouse click location in the comp window coordinates, and how to convert those into layer source coordinates.

Votes

Translate

Translate
LEGEND ,
Jul 07, 2022 Jul 07, 2022

Copy link to clipboard

Copied

I don't think there's any chance of doing that since the viewer has it's own life and you don't know anything about how the panel is set up in the API.

 

Mylenium

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 07, 2022 Jul 07, 2022

Copy link to clipboard

Copied

take a look at the "CCU" SDK sample project. it shows hot to get the mouse click location in the comp window coordinates, and how to convert those into layer source coordinates.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 08, 2022 Jul 08, 2022

Copy link to clipboard

Copied

Thank you Shachar, this is exactly what I want.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 29, 2024 May 29, 2024

Copy link to clipboard

Copied

What is "CCU" SDK

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 29, 2024 May 29, 2024

Copy link to clipboard

Copied

Same question. How did you solve it?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 29, 2024 May 29, 2024

Copy link to clipboard

Copied

the mouse coordinates are part of the data passed to the plugin on a ui event call. take a look at the "CCU" sample project, it's implemented there. no solution required, just copy paste from there.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 29, 2024 May 29, 2024

Copy link to clipboard

Copied

I'm curious if this is only available during custom UI event callbacks. Is it possible to get layer coordiantes as comp space coordinates at other times during an Effect process if your effect does not have a custom UI? (without bringing AEGP in the mix because apparently that's not ideal?)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 29, 2024 May 29, 2024

Copy link to clipboard

Copied

mixing an effect is possible and not problematic in most cases. however, that won't solve this issue.

indeed, the mouse data and conversion callbacks are only available during ui event calls. however, you could emulate that stuff.

the mouse position can be gotten directly directly via the operating system. you can also create a layer-to-comp matrix (and vice versa) using an AEGP call to get the layer and camera matrices. it's a bit of a hassle to set up, but by all means possible.

the one "unknown" there would be the offset between the screen mouse point and the AE window of interest... PF_ConvertLocalToGlobal only works during ui events...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 29, 2024 May 29, 2024

Copy link to clipboard

Copied

em....What is "CCU" sample?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 29, 2024 May 29, 2024

Copy link to clipboard

Copied

The AE SDK is shipped with many sample projects. these projects demonstrate the propper usage of almost all API callbacks. they are also good starting points for various plug-in developments, as well as a good place to grab code from. 
here's the list of said sample projects in the docs:
https://ae-plugins.docsforadobe.dev/intro/sample-projects.html

the "CCU" sample project demonstrates a custom comp ui, and along the way shows how to get mouse coordinates in layer space.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 29, 2024 May 29, 2024

Copy link to clipboard

Copied

LATEST

Thank you so much!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines