Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add functionality to clear shader #1860

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

yiqunw700
Copy link
Contributor

@yiqunw700 yiqunw700 commented Dec 13, 2024

  1. Add a clear all shader menu to clear all shader data from the figma design file
  2. Add a clear shader button to clear the shader from the current selection in the plugin UI
Screenshot 2024-12-13 at 18 53 40

Fixes: #1714

@yiqunw700 yiqunw700 requested a review from rylin8 December 13, 2024 20:31
@yiqunw700 yiqunw700 marked this pull request as ready for review December 13, 2024 20:31
Copy link

github-actions bot commented Dec 13, 2024

Snapshot diff report vs base branch: main
Last updated: Fri Dec 13 19:16:01 PST 2024, Sha: 8f78105
No differences detected

Copy link
Collaborator

@rylin8 rylin8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking that there would be a button next to "Apply Shader" to clear a single node of its shader, instead of, or in addition to, this method of clearing all shaders. A user might have a few shaders in a document and then accidentally apply a shader on the wrong node, in which case there's no way to just remove the shader from that node without clearing all shaders.

Secondly, I don't think there is a way right now to tell if a node has a shader set on it. I think that the shader UI should have some indication that the currently selected node has a shader saved in it, and a way to load that shader code into the text edit box.

support-figma/extended-layout-plugin/src/shader.ts Outdated Show resolved Hide resolved
@yiqunw700 yiqunw700 changed the title Add a clear shader menu Add functionality to clear shader Dec 14, 2024
@yiqunw700 yiqunw700 force-pushed the yiqunw/clean_shader branch 5 times, most recently from 72ea034 to 212f791 Compare December 14, 2024 02:50
@yiqunw700
Copy link
Contributor Author

yiqunw700 commented Dec 14, 2024

I was thinking that there would be a button next to "Apply Shader" to clear a single node of its shader, instead of, or in addition to, this method of clearing all shaders. A user might have a few shaders in a document and then accidentally apply a shader on the wrong node, in which case there's no way to just remove the shader from that node without clearing all shaders.

Secondly, I don't think there is a way right now to tell if a node has a shader set on it. I think that the shader UI should have some indication that the currently selected node has a shader saved in it, and a way to load that shader code into the text edit box.

Good point.
Added a clear shader button in the plugin ui which doesn't check if there is any shader code set though. There is a simple but not very reliable way is to check if the node uses a shader preview image.

Filed a ticket #1877 to track the load shader code in the plugin ui(including update the clear shader button state)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Shader plugin support
2 participants