It is exactly as it is working now: if you use the image "c:\a\b\c\img.jpg", the file "c:\a\b\c\img.jpg.tx" is created (if it doesn't exist or it is outdated).juangea wrote: ↑Tue Jun 15, 2021 12:01 pm Regarding the location of the TX files you asked before (I think), IMHO they should be located in the same folder as the original texture, so for example if you have a texture in your protect with the tax files already generated they will be used or regenerated if they are outdated, but we could store the tax files within the library and copy them over for a new project, that will avoid the need of regenerating them.
Scene texture maps resize policy
Re: Scene texture maps resize policy
Re: Scene texture maps resize policy
Awesome, that allow us to store everything together with the project and our asset management system
Re: Scene texture maps resize policy
I tried to pass the properties like this:Dade wrote: ↑Tue Jun 15, 2021 1:06 pmIt sounds like you are creating the Scene without a resize policy because the resize policy is (after) defined in the render config.B.Y.O.B. wrote: ↑Tue Jun 15, 2021 10:40 am Could it be that I have to apply the policy settings somehow before building the scene, or so?
In BlendLuxCore, the luxcore_scene is built first, then the render config is created with renderconfig = pyluxcore.RenderConfig(config_props, luxcore_scene). In the logs it looks like all the image maps are already loaded before this step happens.
I think, in your case, you have to pass the Resize policy properties to the scene constructor: https://github.com/LuxCoreRender/LuxCor ... ore.h#L772
See the Scene constructor has now an additional optional argument for them.
Code: Select all
image_resize_policy_props = scene.luxcore.config.image_resize_policy.convert()
luxcore_scene = pyluxcore.Scene(image_resize_policy_props)
The properties are:
scene.images.resizepolicy.type = "MIPMAPMEM"
scene.images.resizepolicy.scale = 0.732143
scene.images.resizepolicy.minsize = 64
It looks like the Python constructors (Properties/string) are different from the C++ constructors (Properties, Properties+Properties, filename + Properties):
https://github.com/LuxCoreRender/LuxCor ... .cpp#L1982
Re: Scene texture maps resize policy
I should have aligned the Python API with the C++ API. Note, due to some language difference, if you want to create an empty scene with a resize policy, you have to use something like :
Code: Select all
scene = pyluxcore.Scene(pyluxcore.Properties(), resizePolicyProps)
Re: Scene texture maps resize policy
Thanks, it works now.
What does the scale parameter do when the auto-scaling policies are used? Is it a multiplier applied to the auto-detected optimal size?
E.g. auto-detection says a texture should be scaled from 100x100 to 50x50, scale parameter is set to 0.5, end result would be that the texture is scaled to 0.5 * 0.5 = 0.25 = 25x25, is that what happens?
What does the scale parameter do when the auto-scaling policies are used? Is it a multiplier applied to the auto-detected optimal size?
E.g. auto-detection says a texture should be scaled from 100x100 to 50x50, scale parameter is set to 0.5, end result would be that the texture is scaled to 0.5 * 0.5 = 0.25 = 25x25, is that what happens?
Re: Scene texture maps resize policy
would a user defined multiplier after like MINMEM be possible so if the result isn't perfect we can make it a bit larger or smaller if it wont matter that much. like for example it first runs MINMEM and then it would apply the user defined multiplier after thatB.Y.O.B. wrote: ↑Wed Jun 16, 2021 12:08 pm Thanks, it works now.
What does the scale parameter do when the auto-scaling policies are used? Is it a multiplier applied to the auto-detected optimal size?
E.g. auto-detection says a texture should be scaled from 100x100 to 50x50, scale parameter is set to 0.5, end result would be that the texture is scaled to 0.5 * 0.5 = 0.25 = 25x25, is that what happens?
Re: Scene texture maps resize policy
Yes, exactly. <1.0 to save more memory, >1.0 to have less blurred image maps.B.Y.O.B. wrote: ↑Wed Jun 16, 2021 12:08 pm Is it a multiplier applied to the auto-detected optimal size?
E.g. auto-detection says a texture should be scaled from 100x100 to 50x50, scale parameter is set to 0.5, end result would be that the texture is scaled to 0.5 * 0.5 = 0.25 = 25x25, is that what happens?
Re: Scene texture maps resize policy
It should already work in this way.bestman8 wrote: ↑Wed Jun 16, 2021 1:43 pmwould a user defined multiplier after like MINMEM be possible so if the result isn't perfect we can make it a bit larger or smaller if it wont matter that much. like for example it first runs MINMEM and then it would apply the user defined multiplier after thatB.Y.O.B. wrote: ↑Wed Jun 16, 2021 12:08 pm Thanks, it works now.
What does the scale parameter do when the auto-scaling policies are used? Is it a multiplier applied to the auto-detected optimal size?
E.g. auto-detection says a texture should be scaled from 100x100 to 50x50, scale parameter is set to 0.5, end result would be that the texture is scaled to 0.5 * 0.5 = 0.25 = 25x25, is that what happens?
Re: Scene texture maps resize policy
I downloaded the build yesterday in the night and I can't find where to configure this, where is it?
Re: Scene texture maps resize policy
Render properties, there's a new panel "Image Rescaling".