Skip to main content
Known Participant
October 11, 2021
Question

pysbs.batchtools.thumbnail.generate(), tiling from physical size

  • October 11, 2021
  • 1 reply
  • 255 views

Hi there,

 

We are trying to generate thumbnails using the batchtools.thumbnail module. We are really excited about that new functionality.

 

Our input graphs contain an accurate physical size, and we would like the tiling on the thumbnail to be true to that physical size. But after running a few tests, the output generated by batchtools.thumbnail.generate() doesn't seem to respond to the input graph's physical size.

The documentation mentions that the material_icon_render.sbsar template is based on the PBRrender node. This node has a UV Tiling parameter, which we are hoping could be driven either by:
- the input graph's physical size attribute
- the input graph's physical-size input
But we are not sure how the PBRrender node is hooked up in the template. 

Since we don't have access to material_icon_render.sbs ( we only found the sbsar in the SAT resource folder ), we tried to import material_icon_render.sbsar into a Designer. The tiling doesn't seem to respond to the physical-size input ( see screen shots attached ).

Could you please confirm that in batchtools.thumbnail.generate(), the UV tiling is not automatically set in function of the input graph's physical size? Or are we not using the API correctly? If the tiling is not hooked up yet, are you planning on updating the template and/or pysbs?

Also, if you were able to share the source graph material_icon_render.sbs, it would be great to have more visibility into what to expect from that template.

At last, I wanted to mention that whenever I try to import material_icon_render.sbsar into Designer on my MAC, my laptop crashes. It worked fine on Windows though.

 

Thank you!

This topic has been closed for replies.

1 reply

Community Manager
October 13, 2021

Hello! Effectivelly there are some reasons that we get this behaviour with material_icon_render.sbsar, I am not the right person to explain why, maybe Nico W the creator of this substance can add details.
From SAT side you can give your own sbsar as thumbnail template by giving a sbsar path to the argument:

generate(... aThumbnailTemplate="yourPath"...)

, as long as you respect the usages names on your template's inputs/outputs nodes:

    BASECOLOR = "baseColor",
    NORMAL = "normal",
    EMISSIVE = "emissive",
    ROUGHNESS = "roughness",
    METALLIC = "metallic",
    SPECULARLEVEL = "specularLevel",
    HEIGHT = "height",
    AMBIENTOCCLUSION = "ambientOcclusion",
    OPACITY = "opacity",
    ANISOTROPYLEVEL = "anisotropyLevel",
    ANISOTROPYANGLE = "anisotropyAngle",
    PHYSICALSIZE = "physicalSize",

 
We are also agree to share with you the sbs (as dm), like that you can do your tweaks on it to get the correct behavior for your use cases and pass this new sbsar to the generate() function. 

I hope this solution will help you.

Cheers,

Colin.

ihauliAuthor
Known Participant
October 14, 2021

Thank you. We may create our own template.

Using the --set-value argument, it's possible to pass a graph parameter value to sbsrender. Is it possible to pass a node's parameter value?
Let's say that the template contains a PBRRender node with known uid, and we want to set the 'UV tiling' parameter to 5,5 on that node before rendering. Could we do that using sbsrender's --set-value argument?

The reason I am asking is because the graph we try to render a thumbnail for won't necessarily have a physical size value output.

Community Manager
October 14, 2021
quote

it's possible to pass a graph parameter value to sbsrender. Is it possible to pass a node's parameter value?


Yes, in the same way as graph parameter:

--set-value nodevalueidentifier@values
--set-value physicalsize@1.5,1.5,1.5


An interesting feature could be added to the thumbnail.generate() a way to pass arbitrary param/nodevalue values to the template.

thumbnail.generate(...aThumbnailParams={identifier: values}...)