Graphics

 View Only
  • 1.  Script to change material assigned to slab object...

    Posted 03-10-2021 21:03

    I know I can use a script to change the material assigned to a quad. I would like to do the same to the faces of a slab object. Can this be done? Does anyone have an example of the script?  I've scoured the docs and can't find it.  Any help would be very appreciated!



  • 2.  RE: Script to change material assigned to slab object...

    Posted 03-19-2021 15:38

    Kraig,

    The SetMaterial and SetVolatileTexture Methods both work the same way as for an xpSlabObject, you just need to set the index value for which face of the slab you're assigning the material to (Face = 0; Bevel = 1; Extrusion = 2; BackBevel = 3; Backface = 4)

    Public Function SetMaterial( _
       ByVal FaceIndex As Long, _
       ByVal Material As xpMaterial _
    ) As Boolean
    For a case where you want to set a project material called "Blue" as your Slab bevel:

    dim Slab as xpSlabObject
    dim Blue as xpMaterial

    self.GetObjectByName("Slab1",Slab)
    self.Project.GetMaterialByName("Blue",Blue)

    Slab.SetMaterial(1,Blue)


    #XPression