Skip to content

"Generate Normalmap" action #83

@sczerwinski

Description

@sczerwinski

Create an action for generating a normalmap from a height map, using Sobel operator:

red = sobel(X)
green = sobel(Y)
blue = 255

The action should open a dialog with additional options:

  • Wrap X CheckBox
  • Wrap Y CheckBox
  • Channel ComboBox: red, green, blue, luminosity

The action should be shown in project view popup menu, and in image editor popup menu:

        <action
                id="it.czerwinski.intellij.wavefront.editor.actions.GenerateNormalmapAction"
                class="it.czerwinski.intellij.wavefront.editor.actions.GenerateNormalmapAction">
            <add-to-group group-id="ProjectViewPopupMenu"/>
            <add-to-group group-id="EditorPopupMenu3"/>
        </action>
action.it.czerwinski.intellij.wavefront.editor.actions.GenerateNormalmapAction.text=Generate Normalmap\u2026
action.it.czerwinski.intellij.wavefront.editor.actions.GenerateNormalmapAction.description=Generates normalmap from height map
class GenerateNormalmapAction : AnAction(), DumbAware {

    override fun update(event: AnActionEvent) {
        val project = event.project
        val file = event.getData(CommonDataKeys.VIRTUAL_FILE)
        event.presentation.isEnabled = project != null
        event.presentation.isVisible = /* is a valid texture image file */
    }

    override fun actionPerformed(event: AnActionEvent) {
        // TODO
    }
}

Metadata

Metadata

Assignees

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions