- removed two options from Cycles Materal settings during import ("Diffuse & Transparent", "Emission & Transparent")
- nodetree creation stays the same, but transparent BSDF (along the other needed nodes) is now added when Import Option "Use Alpha" is checked
Details
Diff Detail
Event Timeline
Thanks for the patch, but I do not quite understand its meaning… 'use_transparency' is an image-only setting, without materials, hence it shall absolutely not be affected by material settings imho.
@Bastien Montagne (mont29): I think users would expect the addon to import the image as well as set up the appropriate material/texture/image/nodetree for them.
In case of BI, the addon also sets use_alpha (along with other settings) for the image [and this option "Use Alpha" is also grouped under "Material Settings" in the addon UI].
This patch just aims at doing the same thing for cycles...right now: user chooses a XXX_TRANSPARENT material but doesnt get transparency in render nor UVEditor right away (which seems counter-intuitive, no?). Did you see report T45602: Import Images as Planes corrupts transparent images since 2.74?
Alternative suggestion: maybe we should expose an "Use Alpha" option in the addon UI for cycles as well (instead of doing it implicitly like in this patch)?
OK, see the point, but think you took the issue by the wrong end then. :)
What you probably want to do here is to change how Cycles mat is generated to match behavior of BI mat generation (that is, remove the Diffuse & Transparent, and Emission & Transparent shading options, and automatically use them when 'use_transparency' import option is set).
@Bastien Montagne (mont29): could do that (not sure if this is more intuitive though...)
@Florian Meyer (testscreenings): any opinions (since it was you who first added this)? get rid of "& Transparent" (in favour of "Use Alpha" option)?
did as @Bastien Montagne (mont29) suggested:
- removed two options from Cycles Materal settings ("Diffuse & Transparent", "Emission & Transparent")
- nodetree creation stays the same, but transparent BSDF (along the other needed nodes) is now added when Import Option "Use Alpha" is checked
- use_alpha (along alpha_mode, use_fields) is correctly set for the image now -- calling existing "set_image_options(image)" for this -- formerly ignored when using cycles
[ note: version 1 of this patch was against an older revision, so didnt notice "Use Alpha" was already exposed in the UI already for cycles as well... -- just to clear up my previous comment ]
Aside from minor note below, LGTM. Do you have commit access to addons repo?
| io_import_images_as_planes.py | ||
|---|---|---|
| 479 | No need to call that here, it’s already called in all cases in import_images()… | |
@Bastien Montagne (mont29): I have commit access but something is wrong with my git atm. [not letting me push... I'll sort that out...].
You can push too if you want. Thanx for review anyway!
| io_import_images_as_planes.py | ||
|---|---|---|
| 82 | doh! :) | |