Hello! Add() method should adds a new Decal to the decals list of an object, but when I run the Add method more than one time I don’t get more than the first added decal (can observe it at Properties > Decals panel of the selected object). Howether, once I had success running absolutely the same script and getting many decals on the object, but don’t know actually how it happened and can’t repeat it anymore
import rhinoscriptsyntax as rs
import scriptcontext as sc
import Rhino
import Rhino.Render as rr
bitmap_texture_type_guid = rr.ContentUuids.BitmapTextureType
bmtex = rr.RenderContentType.NewContentFromTypeId(bitmap_texture_type_guid)
bmtex.Filename = "/Users/vs/Desktop/tex01.png"
params = Rhino.Render.DecalCreateParams()
params.TextureInstanceId = bmtex.Id
params.DecalMapping = Rhino.Render.DecalMapping.Planar
params.DecalProjection = Rhino.Render.DecalProjection.Forward
params.Origin = Rhino.Geometry.Point3d(0,0,0)
params.VectorUp = Rhino.Geometry.Vector3d(0,10,0)
params.VectorAcross = Rhino.Geometry.Vector3d(10,0,0)
decal = Rhino.Render.Decal.Create(params)
obj_id = rs.GetObject("Object", 8+16, True, True)
rh_obj = rs.coercerhinoobject(obj_id, True, True)
rh_obj.Attributes.Decals.Add(decal)
rh_obj.CommitChanges()
The result of the successfully added mutiple decals which can’t repeat again
By the way, the same bug happening with the Remove method when I want to remove decals of an object, it simply does nothing with them