Radium-Engine icon indicating copy to clipboard operation
Radium-Engine copied to clipboard

Material Edition

Open rainDiX opened this issue 3 years ago • 7 comments

  • Please check if the PR fulfills these requirements
  • [x] The commit message follows our guidelines
  • [x] Tests for the changes have been added (for bug fixes / features)
  • [x] Docs have been added / updated (for bug fixes / features)

Be aware that the PR request cannot be accepted if it doesn't pass the Continuous Integration tests.

  • What kind of change does this PR introduce? (Bug fix, feature, docs update, ...) New feature

  • What is the current behavior? (You can also link to an open issue here) There is no widget to edit material. Editing a material's renderParameter does not update it's associated attributes. There is no way to get the constraints of a parameter.

  • What is the new behavior (if this is a feature change)? Introduce an interface to edit materials with constrains stored in a JSON file and add a updateState() method to update the material attributes with the values of the renderParameters. Add a GUI component to edit material's parameter.

  • Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?) No

  • Other information:

Screenshot of the MaterialEditionDemoApp :

EditorDemo

rainDiX avatar Jun 01 '22 11:06 rainDiX

Codecov Report

Merging #950 (f1ac39f) into release-candidate (aba762c) will increase coverage by 0.05%. The diff coverage is 47.11%.

:exclamation: Current head f1ac39f differs from pull request most recent head 305762e. Consider uploading reports for the commit 305762e to get more accurate results

@@                  Coverage Diff                  @@
##           release-candidate     #950      +/-   ##
=====================================================
+ Coverage              42.01%   42.07%   +0.05%     
=====================================================
  Files                    325      341      +16     
  Lines                  21766    22579     +813     
=====================================================
+ Hits                    9146     9501     +355     
- Misses                 12620    13078     +458     
Impacted Files Coverage Δ
src/Engine/Data/Material.cpp 100.00% <ø> (ø)
src/Engine/Data/Material.hpp 33.33% <ø> (ø)
...Gui/ParameterSetEditor/MaterialParameterEditor.cpp 0.00% <0.00%> (ø)
...Gui/ParameterSetEditor/MaterialParameterEditor.hpp 0.00% <0.00%> (ø)
src/Gui/ParameterSetEditor/ParameterSetEditor.cpp 0.00% <0.00%> (ø)
src/Gui/ParameterSetEditor/ParameterSetEditor.hpp 0.00% <0.00%> (ø)
src/Gui/Widgets/ConstrainedNumericSpinBox.hpp 0.00% <0.00%> (ø)
src/Gui/Widgets/ConstrainedNumericSpinBox.inl 0.00% <0.00%> (ø)
src/Gui/Widgets/ControlPanel.cpp 0.00% <0.00%> (ø)
src/Gui/Widgets/ControlPanel.hpp 0.00% <0.00%> (ø)
... and 31 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

codecov[bot] avatar Jun 01 '22 17:06 codecov[bot]

Trying to make a simple example that show all edition capabilities and how to use the control panel independently of materials, I found several problems that should be fixed before this PR could be merged. I put the WIP tag until I fix everything.

MathiasPaulin avatar Jun 24 '22 17:06 MathiasPaulin

There is still big work todo but here is a version more general and robust than the initial PR. I also add a demonstration on how to edit general parameterSet. Capture d’écran 2022-07-18 à 18 41 11

I now think that the proposal could be merged and improved after that. WIP tag removed.

MathiasPaulin avatar Jul 18 '22 16:07 MathiasPaulin

Still WIP : some TODO : range iterator over bijective association, some code factorization using template parameters ... will be done soon.

MathiasPaulin avatar Jul 27 '22 16:07 MathiasPaulin

To ease review, it may be a good idea to split the PR so that bijective association comes afterward.

First: material edition without enum and bijective association Second: bijective association used for enum and other places in radium (eg Mesh attrib translator).

dlyr avatar Jul 28 '22 12:07 dlyr

it may be a good idea to split the PR so that bijective association comes afterward.

I don't think so. This PR is about RenderParameter edition, with a demonstration covering both pure parameter set and Material parameters. As there are uses cases of enum as Parameter, with big issues in edition without having a bijective association between the enum value (correctly typed and stored in the RenderParameter) and the string (used in the Gui), the PR should cover this uses cases.

What I agree for, is the usage of bijective association outside of RenderParameter edition (e.g. on your mesh use case) that can come afterward.

MathiasPaulin avatar Jul 28 '22 13:07 MathiasPaulin

Fine with that, so I'll review your proposal and your use cases in its current form.

dlyr avatar Jul 28 '22 13:07 dlyr