docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method CreateInstancesBySimilarity

    CreateInstancesBySimilarity(OccurrenceList, double, double, bool, bool, bool)

    Create instances when there are similar parts. This can be used to repair instances or to simplify a model that has similar parts that could be instantiated instead to reduce the number of unique meshes (reduces drawcalls, GPU memory usage and file size). Using 1.0 (100%) in all similarity criteria is non destructive. Using lower values will help finding more similar parts, even if their polycount or dimensions varies a bit.

    Declaration
    public void CreateInstancesBySimilarity(OccurrenceList occurrences, double dimensionsSimilarity, double polycountSimilarity, bool ignoreSymmetry, bool keepExistingPrototypes, bool createNewOccurrencesForPrototypes)
    Parameters
    Type Name Description
    OccurrenceList occurrences

    Occurrence for which we want to find similar parts and create instances using prototypes.

    double dimensionsSimilarity

    The percentage of similarity on dimensions. A value of 1.0 (100%) will find parts that have exactly the same dimensions. A lower value will increase the likelihood to find similar parts, at the cost of precision.

    double polycountSimilarity

    The percentage of similarity on polycount. A value of 1.0 (100%) will find parts that have exactly the same polycount. A lower value will increase the likelihood to find similar parts, at the cost of precision.

    bool ignoreSymmetry

    If True, symmetries will be ignored, otherwise negative scaling will be applied in the occurrence transformation.

    bool keepExistingPrototypes

    If True, existing prototypes will be kept. Otherwise, the selection will be singularized and instanced will be created from scratch.

    bool createNewOccurrencesForPrototypes

    If True, a new occurrence will be created for each prototype. Those occurrences won't appear in the hierarchy, and so deleting one of the part in the scene has no risks of singularizing. If set to False, an arbitrary occurrence will be used as the prototype for other similar occurrences, which is less safe but will result in less occurrences.

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)