Cluster.IsAlwaysComplete operator




Returns true if the cluster is maintained as always complete. An always-complete cluster always covers all the components of the Geometry, even when new components are added by a modeling operation; however, notice that a cluster which covers all components of a geometry is not necessarily always-complete. See Geometry.AddCluster in for details on how to create a cluster that is always-complete.

Notice that some ClusterProperty types can only be added to clusters that are always complete. These types are vertex color, uv and symmetry map properties.

Note: It is not possible to remove elements from an always-complete cluster.

C# Syntax

Boolean Cluster.IsAlwaysComplete();

Scripting Syntax

oBoolean = Cluster.IsAlwaysComplete();

Return Value



JScript Example

// Create a 1X1 grid. Such geometry only have 4 sampled points: 0,1,2,3.
oGrid = CreatePrim("Grid", "MeshSurface", null, null);
SetValue("grid.polymsh.geom.subdivu", 1, null);
SetValue("grid.polymsh.geom.subdivv", 1, null);
// Add a sampled point cluster covering all sampled points. By passing an
// explicit array, it will create a cluster which is not always complete.
oCluster = oGrid.ActivePrimitive.Geometry.AddCluster( siSampledPointCluster,"NonCompleteCluster",Array(0,1,2,3));
logmessage("Is cluster " + oCluster + " complete? " + (oCluster.IsAlwaysComplete() ? "yes" : "no"));
// Add a sampled point cluster covering all sampled points. By passing no 
// explicit array, it will create a cluster which is always complete.
oCompleteCluster = oGrid.ActivePrimitive.Geometry.AddCluster( siSampledPointCluster,"CompleteCluster" );
logmessage("Is cluster " + oCompleteCluster + " complete? " + (oCompleteCluster.IsAlwaysComplete() ? "yes" : "no"));
        oProperty = oCluster.AddProperty("Texture Projection", false, "UV Property");
catch( e )
        logmessage("Error; can't add a UV cluster property on cluster" + oCluster);
oProperty = oCompleteCluster.AddProperty("Texture Projection", false, "UV Property");
logmessage("UV cluster property " + oProperty + " was added to complete cluster " + oCompleteCluster);
// The output of this script is:
//INFO : Is cluster grid.polymsh.cls.NonCompleteCluster complete? no
//INFO : Is cluster grid.polymsh.cls.CompleteCluster complete? yes
//ERROR : 2000 - The cluster property could not cannot be added. This type of cluster property requires the parent cluster to be always complete. See "AddProperty" method reference for more information about this.
//INFO : Error; can't add a UV cluster property on clustergrid.polymsh.cls.NonCompleteCluster
//INFO : UV cluster property grid.polymsh.cls.CompleteCluster.UV_Property was added to complete cluster grid.polymsh.cls.CompleteCluster

See Also

Geometry.AddCluster SceneItem.AddProperty