- Substance 3D home
- Home
- Command Line Tools
- Command Line overview
- sbsbaker
- sbscooker
- sbsmtools
- sbsmutator
- sbsrender
- sbsupdater
- Command Line overview
- Pysbs - Python API
- Pysbs - Python API overview
- Getting started
- General topics
- Examples
- API Content
- API Content overview
- Substance definitions
- Common interfaces
- compnode
- context projectmgr
- graph
- mdl
- modelgraphindex
- modelannotationnames
- modelgraph
- modelgraphgenerator
- modelgraphimplementation
- modelnodenames
- modeloperand
- modulegraphindex
- moduleannotation
- moduleconnection
- modulegraph
- modulegraphgenerator
- modulegraphimplementation
- modulegraphlibrary
- modulegraphregister
- modulenode
- modulenodeimplementation
- modulenodeinstance
- moduleoperand
- moduleoutputbridging
- moduleparaminput
- params
- projectmgrdoc
- sbsarchive
- sbscommon
- sbspreset
- sbsproject
- substance
- Libraries
- sbsenum
- sbslibrary
- sbsbakerslibrary
- Helpers
- Execution context
- API Change log
- Samples
- Setup and Getting Started
- Integrations
- Substance Maya toolset
- Changelog overview
sbsbaker_info_handlers
Example of usage with SbsBakerInfoOutputHandler (output_handlers module):
# call a sbsbaker_info with the kwarg output_handler=True to get an OutputHandler instead of Popen # the OutputHandler will stop the interpreter during the batchtool process exactly like Popen.wait() out = batchtools.sbsbaker_info('foo.fbx', output_handler=True) print(out) # <pysbs.batchtools.output_handlers.SbsBakerInfoOutputHandler object at 0x7f8808fe1c50> # to get the result use get_results, an OutputHandler's common method results = out.get_results() print(results) # [<pysbs.batchtools.sbsbaker_info_handlers.SbsBakerInfoEntityStruct object at 0x7f7757881c10>, <pysbs.batchtools.sbsbaker_info_handlers.SbsBakerInfoEntityStruct object at 0x7f7757881e10>] # SbsBakerInfoOutputHandler.get_results() return a list of SbsBakerInfoEntityStruct. Follow the doc to get more details of SbsBakerInfoEntityStruct # as mush as possible each member type is converted in a python type. for entity in results: # some examples of its different members print(entity.label) for mesh in entity.meshes: print(mesh.vertices_number) for uv in mesh.uvs: print(uv.udim_tiles) for subpart in mesh.submeshes: print(subpart.color) # it become easy to retrieve all the udims or uv tiles: all_udims = set([udim for entity in out for mesh in entity.meshes for uv in mesh.uvs for udim in uv.udim_tiles]) # an other OutputHandler common method is dump() to write the output in a stream IO (file) with open("dumped_file.ext", 'w') as f: out.dump(f)
class batchtools.sbsbaker_info_handlers.SbsBakerInfoBboxStruct(minimal_point=(), maximal_point=(), center=(), size=())
Bases: object
Bbox handles bounding box info of an object, member of SbsBakerInfoEntityStruct
.
Parameters: |
|
---|
class batchtools.sbsbaker_info_handlers.SbsBakerInfoEntityStruct(label='', enabled=True, bounding_box=None, location=None, meshes=None)
Bases: object
Entity is the higher structure of sbsbaker info. It defined an object in the scene. SbsBakeInfoOutputHandler info return a list of SbsBakerInfoEntityStruct instance. Each arguments is accessible with attribute members.
Parameters: |
|
---|
enabled
class batchtools.sbsbaker_info_handlers.SbsBakerInfoLocStruct(local_transformation, global_transformation)
Bases: object
Loc handles location info of an object, member of SbsBakerInfoEntityStruct
. Warning, the values is not relevant with obj format.
Parameters: |
|
---|
class batchtools.sbsbaker_info_handlers.SbsBakerInfoMeshStruct(label='', vertices_number=0, uvs=None, submeshes=None)
Bases: object
Mesh handles mesh info part of an object, member of SbsBakerInfoEntityStruct
.
Parameters: |
|
---|
class batchtools.sbsbaker_info_handlers.SbsBakerInfoSubmeshStruct(label='', color='', triangles_number=0)
Bases: object
Submesh handles submesh’s material info for each mesh’s submesh, member of SbsBakerInfoMeshStruct
.
Parameters: |
|
---|
class batchtools.sbsbaker_info_handlers.SbsBakerInfoUvStruct(is_in_unit_square='1', points_number=0, uv_tiles='', udim_tiles='')
Bases: object
Uv handles UV info for each mesh’s uv sets, member of SbsBakerInfoMeshStruct
.
Parameters: |
|
---|
udim_tiles
uv_tiles