ymt3d/MPP-Blender-Addon

+2 feature requests!

Opened this issue · 11 comments

Today I tested a bit more the addon and I'd like to share 2 more ideas for features:
1- ability to copy/paste materials to more objects types other than MESH type only, like:
ob.type in {'MESH', 'CURVE', 'SURFACE', 'META', 'FONT'}

2- ability to sample a color from an image and paste it as a default principled material with the color assigned (or change only the color if material is already assigned).

Video: https://od.lk/s/MjBfMjM0NDIyMzhf/mpp-2-feature-requests.mp4

Ps: It was very cool to see the addon pasting the material to an object with no material slots already assigned to it! Good work on that for user experience!

ymt3d commented

Thank you, I will try to get the video to work for me.

1-I found the non-MESH correspondence very necessary after watching your video. I consider this correspondence as my conceptual and essential task.

2- I thought the color only paste was a very unique and very great idea when it could be done. I will consider this as well when the other issues are resolved.

ymt3d commented

hi juliocargnin
There are still some issues, but we have applied support for non-mesh objects. Please try it out!

Found some issues:

  • Not able to PICK the material from the active object when its type is a CURVE, SURFACE or FONT.

  • If you have multiple selected objects and the active object is a CURVE, SURFACE or TEXT and try to paste on the active object it will paste the picked material to all the selected objects and not to only the object under the cursor.

Let me know if you need a video show casing these issues.

ymt3d commented

Thank you. We are aware of this problem, and it is also described in README.
The ray cast does not work on non-mesh active objects, and no solution has been found.
If it doesn't work, compromise and switch to using only slot 0 of the material.

The ray cast does not work on non-mesh active objects

I see...You might try something like:

  1. Store the current selection and active object firstly,
  2. Then deselect all the objects and clear active
  3. Perform the program...
  4. Once finished the code restore selection and active object.

I noticed now the edit mode is starting to work much better!!

But I found the issue that it is not possible to pick a second material on the same object while in edit mode. So you have to leave edit mode to be able to pick other materials of the same mesh.

ymt3d commented

Hi I have released v0.6.9 which fixes the problem with non-mesh objects.
I hope you will give it a try.

Worked as expected picking from active non-mesh objetcs!

Still in edit mode persists the issue:

not possible to pick a second material on the same object while in edit mode

Might be a raycast limitation while in edit mode?
If so, you may try to force the picking method to work always in object mode switching the mode to Object Mode and restoring the previous mode state once the picking is completed.

Another suggestion regarding pasting user feedback:
The viewport always display a message "Paste: Material" even though you paste in an empty area.
It would be more clear to the user to display that message only when pasting succeed or an alternative message if pasting is not accomplished.

ymt3d commented

Thanks again!

I understand the problem with the edit mode. ray cast has a lot of problems. However, I believe that there are cases when I want to pick correctly in edit mode with the modifier deactivated. So I think reverting to object mode is a last resort.

Next, v0.7.0 addresses the text display issue.
I have only hidden the text when there is no mesh selected when pasting.
What are some other patterns of cases where pasting fails? We would like to consider a variety of cases.

I understand the problem with the edit mode. ray cast has a lot of problems. However, I believe that there are cases when I want to pick correctly in edit mode with the modifier deactivated. So I think reverting to object mode is a last resort.

Tested some variety of pasting combinations and only in edit mode the picking seems unreliable at the moment.
So my suggestion for picking algorithm would be something like:
1 . Store the current selection, active object and mode before running the programmed picking method;
2 . Switch to object mode;
3 . Run the picking programmed method (here it won't fail as the picking seems reliable enough when running on Object Mode
4 . Restore selection, active object and mode.

This way you'd have the picking program always being executed in Object Mode regardless the User's Active Mode but user would not notice anything as the program takes care of recovering initial states once picking is completed.

Do you think that something like that could overcome the limitations of picking while in Edit Mode? Or would that be too difficult to program?

Ps.: I noticed that pasting works much better then the picking when in Edit Mode respecting the case under the cursor.

ymt3d commented

Thank you very much. Yes, it will probably work fine if you follow that suggestion.
I have found Pick in edit mode to be useful in that it does not take modifiers into account, but I am finding it difficult to solve the problem, so I would like to modify it in the way you suggested.