Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HDRI & texture randomisation #160

Open
barney2074 opened this issue May 23, 2022 · 1 comment
Open

HDRI & texture randomisation #160

barney2074 opened this issue May 23, 2022 · 1 comment

Comments

@barney2074
Copy link

Hi,

thank you for ZPY- loving it & just what I need- thank you..!

I've worked through the tutorials. Suzanne 3 YouTube content seems to differ from the latest Suzanne 3 python run.py on GitHub.
Youtube has a Python list of explicit texture and HDRI paths, whereas Github seems to have moved it into a function ??

To get it to work- from the documentation I though I just needed to create a \textures directory and a \hdris\1k directory in the same folder as the .blend file ??

so:
path/foo.blend
path/textures/1.jpg
path/textures/2.jpg
path/hdris/1k/a.exr
path/hdris/1k/b.exr

However- I get a bunch of errors- looks like this is not correct
I would be very grateful if you could point me in the right direction
thanks again

Andrew

@rishikeshrmadan
Copy link

rishikeshrmadan commented Oct 16, 2022

Hi,

thank you for ZPY- loving it & just what I need- thank you..!

I've worked through the tutorials. Suzanne 3 YouTube content seems to differ from the latest Suzanne 3 python run.py on GitHub. Youtube has a Python list of explicit texture and HDRI paths, whereas Github seems to have moved it into a function ??

To get it to work- from the documentation I though I just needed to create a \textures directory and a \hdris\1k directory in the same folder as the .blend file ??

so: path/foo.blend path/textures/1.jpg path/textures/2.jpg path/hdris/1k/a.exr path/hdris/1k/b.exr

However- I get a bunch of errors- looks like this is not correct I would be very grateful if you could point me in the right direction thanks again

Andrew

Hi Andrew! You may have found the solution already, but for others wondering, there's two options which I found by looking at assets.py in the zpy source code.

The first is setting an environment variable named ASSET pointing to a path, and following a specific folder structure which you can infer from the source code.
The second is placing them in a specific place, which

You can print this out:
print(zpy.assets.get_asset_lib_path())
If this returns None with a log message that means that the ASSET env variable isn't set, this isn't mandatory for textures, just place them in a location as follows:

print(bpy.utils.script_path_user())

In my case on Windows, it was:
C:\Users\[my_username]\AppData\Roaming\Blender Foundation\Blender\2.93\scripts

then the entire path was:
C:\Users\[my_username]\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\zpy_addon

I downloaded some textures from polyhaven, like:
https://dl.polyhaven.org/file/ph-assets/Textures/jpg/1k/wood_planks_dirt/wood_planks_dirt_diff_1k.jpg
https://dl.polyhaven.org/file/ph-assets/Textures/jpg/1k/wood_table_001/wood_table_001_diff_1k.jpg

and it worked.

Edit: had messed up the order of the commands, fixed it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants