[2.80] Lily Surface Scraper: Import material from a simple URL

Thanks for the update, but there’s an error trying to import textures after selecting the variant:

Happens the same trying to import HDRI from the world tab.
Tested with 2.80 stable version and i get the same error.

Mmh weird, can you try to paste this snippet in a Python console tab in Blender:

mat = bpy.data.materials.new(name="Test")
mat.use_nodes = True
nodes = mat.node_tree.nodes
texture_node = nodes.new(type="ShaderNodeTexImage")
texture_node.color_space

I really just downloaded the current official Blender 2.80. Tested on Windows 64bit.

Same error:

Forget to say i’m using Manjaro Linux 18.1 64 bits.

Ok, still weird to see that Windows and Linux version have different APIs… Since the current status looks more like your version than mine, the problem might be on the Windows build side.

Anyway, thanks to @ogierm on GitHub the issue has been addressed: https://github.com/eliemichel/LilySurfaceScrapper/pull/11

edit: My bad, it turns out I was running an old version of 2.80, not the one I had just installed.

1 Like

API should be the same but maybe Linux is more strict with it or viceversa.
Glad to see it resolved and time to enjoy it !!
Thanks both for the quick fix.

Almost forgot to ask something. I don’t see any license on the github page?.
If you don’t know, it must be GPL.

Oh, I indeed surprisingly forgot to add a licensing file… will fix right away. I am indeed aware that it must be GPL, I had to deal with this constraint lately. :wink:

GPL compatible (like MIT, for example).

No.
Add-ons that use Blender API must be GPL, but if parts of the add-on don’t touch the API, they could be compatible license, like MIT.

If you check the latest changes on github you will see this addon is dual licensed GPL and MIT now.

I see, i guess that’s why you made it GPL+MIT, so the permissive part of the add-on can be used to communicate with closed source counterparts.

The GPL doesn’t enforce that. The license speaks about giving the user the the same freedoms the GPL grants if you distribute a derived work. GPL compatible licenses do that. The GPL FAQ (whis is the GPL interpreted by the FSF) also talks about GPL compatibility, not about having to use the GPL itself for work based on GPL code.

If you distribute your code together with Blender, you have to do that under the GPL for the combined work. Your code can still be not GPL then, but must be GPL compatible.

That’s how I understand it. I’m no lawyer, though, and this is no legal advice, but only my opinion.

Please do not make this yet another thread about the GPL license. Just to conclude, alinea 2.b. states that:

You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.

It says “this license”, not “a compatible license”. The notion of GPL-compatible license occurs when dealing with dependencies. If a program is GPL, its dependencies must be GPL-compatible but its dependees must be GPL. The ever lasting question is to determine whether using import bpy somewhere makes the script “derived from” bpy. I don’t want to defend one point of view or the other here, I just decided to license these parts of the script under the GPL and the remaining parts under the MIT license. Period.

Meanwhile, I released a version 1.2.0 with some bug fixes and neat UI improvments! Thanks a lot to @ogierm and @alisherks for their help, both for design and implementation :slight_smile:

LilySurfaceScrapper v1.2.0

Changelog

  • Add a “import from clipboard” button for even quicker material import (no need to paste)
  • Handle two-sided materials available on cgbookcase.com
  • Use the new alpha slot of Principled BSDF node
  • Add buttons pointing to material sources
  • Use the XML API of CC0Textures for more robustness to future changes
  • Fix cgbookcase scrapper
  • Fix remaining colorspace issues
1 Like

Me neither, I just wanted to voice my confusion about a statement that I didn’t understand. I absolutely respect your decision to license your code how you see fit, in fact I find your solution very good.

But of course this thread is about your work, not about license discussions. I was offtopic and I’m sorry.

1 Like

This is really amazing! Thanks so much.

The only thing I’d love to see is the displacement maps, etc being added in on the shader automatically, or downloaded at all. Right now you can to manually create the structure and load in the texture, even if it downloaded, but sometimes only three of the five or more available files are downloaded.

In testing it seems Lily Scrapper downloads the displacement maps from ccOtextures, but not from Texture Haven or cgbookcase. From Texture Haven it downloads only the basecolor, normal, and roughness.
From cgbookcase Lily Scrapper also only downloads the baseColor, normal, and roughness. On the textures tested this left out the AO and the height.

This means to get the displacement, AO, Bump, Diffuse, etc, you have to manually download all the textures and then put them in the folder where Lily Scrapper put them, and then set up the shader. It’s not the end of the world but it basically defeats the point of the addon if you have to do more than half of it yourself anyway.

If it would scrape all the available textures and then build the shader with everything, then this would be 100% amazing.

Regardless, really great stuff and it’s going to be super helpful. Thanks again.

Try the newest version of the add-on (download the repo as a zip), I fixed that here:

I get an error when enabling the add-on.


I’m on macOS. Any help would be appreciated.

Hello @Macwelshman!
Since I did not have access to MacOS I could not get the binaries for lxml, so you can help me on this.

This would enable the plugin to be used by any other MacOS user. :wink:

1 Like

Hi @Mink
Here’s a link to the lxml file. https://www.dropbox.com/s/sn3vs80dw1e6jz9/lxml.zip?dl=0
Replaced old version in site-packages and now works for me.

Many thanks.

Thanks! I released a new version with OSX support: https://github.com/eliemichel/LilySurfaceScrapper/releases/tag/v1.2.1

I get this error when trying to import from cc0textures :sob::

Traceback (most recent call last):
  File "/home/toni/.config/blender/2.82/scripts/addons/LilySurfaceScrapper/frontend.py", line 105, in invoke
    return self.execute(context)
  File "/home/toni/.config/blender/2.82/scripts/addons/LilySurfaceScrapper/frontend.py", line 108, in execute
    bpy.ops.object.lily_surface_import('EXEC_DEFAULT', url=bpy.context.window_manager.clipboard)
  File "/home/toni/blender-git/boneMaster/bin/2.82/scripts/modules/bpy/ops.py", line 199, in __call__
    ret = op_call(self.idname_py(), C_dict, kw, C_exec, C_undo)
RuntimeError: Invalid Input Error: Material provider not supported. See the documentation for a list of supported material providers.


location: <unknown location>:-1