The MergeMaterial module

PR 28467 When a custom member creates a MergeMaterial the resulting material's solids_creator_uuid will be set to the custom member's guid_manufacturing. (v7.3)

The MergeMaterial() function contained in the parametric MergeMaterial module can be used to combine multiple materials into a single material. It is similar to Fuse Material , but is not directly related to Fuse Material and does not produce equivalent results.

Here's an example of a script that you can Run .

# Merges all the material on the member you select.
import member
import MemberBase
import MergeMaterial
import param

mem = member.MemberLocate("Locate member to merge material")
param.ClearSelection()
mb = MemberBase.GetMemberLink( mem .number, True )
dummy_mtrl = False

MergeMaterial.MergeMaterial( mem .number,
range( mem .mtrl_quantity ),
mb .GetXform(), dummy_mtrl )

To get help on the MergeMaterial module, you can use the built-in Python functions dir() and help() . Compare this documentation with the example that is shown below, then Run that example to get a better understanding of what MergeMaterial() does.

SDS2 Python Prompt

>>> import MergeMaterial                            # import the module
>>>
>>> dir(MergeMaterial)                                 # do a dir() on the module name
['MergeMaterial', '__doc__', '__name__', '__package__']
>>>
>>> help(MergeMaterial)                               # get help on the module
Help on module MergeMaterial:

NAME
MergeMaterial

FILE
(built-in)

FUNCTIONS
MergeMaterial(...)                                             # help on MergeMaterial()
C++ signature:
MergeMaterial( int , boost::python::list , Xform , bool ) -> void*

MergeMaterial( arg1 , arg2 , arg3 , arg4 )

The 1st argument for MergeMaterial( arg1 , arg2, arg3, arg4) takes an integer which corresponds to a member number.

The 2nd argument for MergeMaterial(arg1, arg2 , arg3, arg4) takes a list of materials on the member whose number is specified in the first argument.

The 3rd argument for MergeMaterial(arg1, arg2, arg3 , arg4) takes an Xform.

The 4th argument for MergeMaterial(arg1, arg2, arg3, arg4 ) takes True or False. When the 4th argument is True, the result of MergeMaterial() will be dummy material .

page 1 | contents | modules | top