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
}
}
Create an action for generating a normalmap from a height map, using Sobel operator:
The action should open a dialog with additional options:
CheckBoxCheckBoxComboBox: red, green, blue, luminosityThe action should be shown in project view popup menu, and in image editor popup menu: