fn shape_may_set_material_parameters(ps: &ParamSet) -> bool {
    for p in &ps.textures {
        // Any texture other than one for an alpha mask is almost
        // certainly for a Material (or is unused!).
        if p.name != "alpha" && p.name != "shadowalpha" {
            return true;
        }
    }
    // Special case spheres, which are the most common non-mesh primitive.
    for p in &ps.floats {
        if p.n_values == 1 && p.name != "radius" {
            return true;
        }
    }
    // Extra special case strings, since plymesh uses "filename",
    // curve "type", and loopsubdiv "scheme".
    for p in &ps.strings {
        if p.n_values == 1 && p.name != "filename" && p.name != "type" && p.name != "scheme" {
            return true;
        }
    }
    // For all other parameter types, if there is a single value of
    // the parameter, assume it may be for the material. This should
    // be valid (if conservative), since no materials currently take
    // array parameters.
    for p in &ps.bools {
        if p.n_values == 1 {
            return true;
        }
    }
    for p in &ps.ints {
        if p.n_values == 1 {
            return true;
        }
    }
    for p in &ps.point2fs {
        if p.n_values == 1 {
            return true;
        }
    }
    for p in &ps.vector2fs {
        if p.n_values == 1 {
            return true;
        }
    }
    for p in &ps.point3fs {
        if p.n_values == 1 {
            return true;
        }
    }
    for p in &ps.vector3fs {
        if p.n_values == 1 {
            return true;
        }
    }
    for p in &ps.normals {
        if p.n_values == 1 {
            return true;
        }
    }
    for p in &ps.spectra {
        if p.n_values == 1 {
            return true;
        }
    }
    false
}
// Attempt to determine if the ParamSet for a shape may provide a value for
// its material's parameters. Unfortunately, materials don't provide an
// explicit representation of their parameters that we can query and
// cross-reference with the parameter values available from the shape.
//
// Therefore, we'll apply some "heuristics".
Attempt to determine if the ParamSet for a shape may provide a value for
its material's parameters. Unfortunately, materials don't provide an
explicit representation of their parameters that we can query and
cross-reference with the parameter values available from the shape.

Therefore, we'll apply some "heuristics".
Attempt to determine if the ParamSet for a shape may provide a value for its material ' s parameters . Unfortunately materials don ' t provide an explicit representation of their parameters that we can query and cross - reference with the parameter values available from the shape . Therefore we ' ll apply some " heuristics " .
fn shape_may_set_material_parameters(ps: &ParamSet) -> bool {
    for p in &ps.textures {
        // Any texture other than one for an alpha mask is almost
        // certainly for a Material (or is unused!).
        if p.name != "alpha" && p.name != "shadowalpha" {
            return true;
        }
    }
    // Special case spheres, which are the most common non-mesh primitive.
    for p in &ps.floats {
        if p.n_values == 1 && p.name != "radius" {
            return true;
        }
    }
    // Extra special case strings, since plymesh uses "filename",
    // curve "type", and loopsubdiv "scheme".
    for p in &ps.strings {
        if p.n_values == 1 && p.name != "filename" && p.name != "type" && p.name != "scheme" {
            return true;
        }
    }
    // For all other parameter types, if there is a single value of
    // the parameter, assume it may be for the material. This should
    // be valid (if conservative), since no materials currently take
    // array parameters.
    for p in &ps.bools {
        if p.n_values == 1 {
            return true;
        }
    }
    for p in &ps.ints {
        if p.n_values == 1 {
            return true;
        }
    }
    for p in &ps.point2fs {
        if p.n_values == 1 {
            return true;
        }
    }
    for p in &ps.vector2fs {
        if p.n_values == 1 {
            return true;
        }
    }
    for p in &ps.point3fs {
        if p.n_values == 1 {
            return true;
        }
    }
    for p in &ps.vector3fs {
        if p.n_values == 1 {
            return true;
        }
    }
    for p in &ps.normals {
        if p.n_values == 1 {
            return true;
        }
    }
    for p in &ps.spectra {
        if p.n_values == 1 {
            return true;
        }
    }
    false
}
fn shape_may_set_material_parameters ( ps : & ParamSet ) -> bool { for p in & ps . textures { // Any texture other than one for an alpha mask is almost // certainly for a Material (or is unused!). if p . name != " " && p . name != " " { return true ; } } // Special case spheres, which are the most common non-mesh primitive. for p in & ps . floats { if p . n_values == 1 && p . name != " " { return true ; } } // Extra special case strings, since plymesh uses "filename", // curve "type", and loopsubdiv "scheme". for p in & ps . strings { if p . n_values == 1 && p . name != " " && p . name != " " && p . name != " " { return true ; } } // For all other parameter types, if there is a single value of // the parameter, assume it may be for the material. This should // be valid (if conservative), since no materials currently take // array parameters. for p in & ps . bools { if p . n_values == 1 { return true ; } } for p in & ps . ints { if p . n_values == 1 { return true ; } } for p in & ps . point2fs { if p . n_values == 1 { return true ; } } for p in & ps . vector2fs { if p . n_values == 1 { return true ; } } for p in & ps . point3fs { if p . n_values == 1 { return true ; } } for p in & ps . vector3fs { if p . n_values == 1 { return true ; } } for p in & ps . normals { if p . n_values == 1 { return true ; } } for p in & ps . spectra { if p . n_values == 1 { return true ; } } false }
Attempt to determine if the ParamSet for a shape may provide a value for
its material's parameters.
Attempt to determine if the ParamSet for a shape may provide a value for its material ' s parameters .
ps
&ParamSet