// =========================================================================== // Copyright 2018 Autodesk, Inc. All rights reserved. // // Use of this software is subject to the terms of the Autodesk license // agreement provided at the time of installation or download, or which // otherwise accompanies this software in either electronic or hard copy form. // =========================================================================== // // hasSwatch : Given a node, return true if it's node type has a swatch. // // The following list was assembled by grepping the repo for files named // AETemplate.mel that invoked AEswatchDisplay, as of July 17th, // 2008, and should be updated periodically, for best results :-). // Ideally, there should be a cleaner way to determine this... // global string $gTypesWithSwatch[] = { "adsk_bump_microbevel", "ambientLight", "anisotropic", "anisotropicShader", "areaLight", "AshliShader", "backFillShader", "blendColors", "blinn", "brickTexture", "brownian", "bulge", "bump2d", "bump3d", "cameraTemplateCommon.mel", "cameraView", "cells", "cgfxShader", "checker", "checkerTexture", "clamp", "cloth", "cloud", "cMuscleShader", "composite", "condition", "contour_composite", "contour_contrast_function_levels", "contour_contrast_function_simple", "contour_only", "contour_ps", "contour_shader_combi", "contour_shader_curvature", "contour_shader_depthfade", "contour_shader_factorcolor", "contour_shader_framefade", "contour_shader_layerthinner", "contour_shader_randomtransparency", "contour_shader_randomwidth", "contour_shader_simple", "contour_shader_widthfromcolor", "contour_shader_widthfromlight", "contour_shader_widthfromlightdir", "contour_store_function", "contour_store_function_simple", "contrast", "contrastNode", "crater", "CustomPhong", "cvColorShader", "defaultLightList", "defaultRenderUtilityList", "defaultShaderList", "defaultTextureList", "depthShader", "dgs_material", "dgs_material_photon", "dielectric_material", "dielectric_material_photon", "DiffractionShader", "DiffractionShader", "directionalLight", "directLight", "displacementShader", "dispNodeExample", "dotTexture", "dotTexture3D", "doubleShadingSwitch", "doubleSwitch", "envBall", "envChrome", "envCube", "envFog", "environmentFog", "envSky", "envSphere", "file", "flame", "fractal", "gammaCorrect", "gammaNode", "geomNode", "granite", "grid", "grid2DTexture", "gridTexture3D", "hairTubeShader", "hsvToRgb", "hwPhongShader", "hwShader", "imagePlane", "interpNode", "lambert", "lambertShader", "lava", "layeredShader", "layeredTexture", "leather", "lightFog", "lightInfo", "lightLinker", "lightList", "luminance", "marble", "materialFacade", "materialInfo", "maya_illum_lambert", "MayaPhong", "mentalray", "mentalrayPhenomenon", "mentalrayTexture", "mentalrayVertexColors", "mi_bump_flakes", "mi_car_paint_phen", "mi_metallic_paint", "mi_metallic_paint_x", "mi_metallic_paint_x_passes", "mia_envblur", "mia_exposure_photographic", "mia_exposure_simple", "mia_lens_bokeh", "mia_light_surface", "mia_material", "mia_material_x", "mia_material_x_passes", "mia_physicalsky", "mia_physicalsun", "mia_portal_light", "mia_roundcorners", "mib_amb_occlusion", "mib_bent_normal_env", "mib_blackbody", "mib_bump_basis", "mib_bump_map", "mib_bump_map2", "mib_cie_d", "mib_color_alpha", "mib_color_average", "mib_color_intensity", "mib_color_interpolate", "mib_color_mix", "mib_color_spread", "mib_continue", "mib_dielectric", "mib_fg_occlusion", "mib_geo_add_uv_texsurf", "mib_geo_cone", "mib_geo_cube", "mib_geo_cylinder", "mib_geo_instance", "mib_geo_instance_mlist", "mib_geo_sphere", "mib_geo_square", "mib_geo_torus", "mib_glossy_reflection", "mib_glossy_refraction", "mib_illum_blinn", "mib_illum_cooktorr", "mib_illum_hair", "mib_illum_lambert", "mib_illum_phong", "mib_illum_ward", "mib_illum_ward_deriv", "mib_lens_clamp", "mib_lens_stencil", "mib_light_infinite", "mib_light_photometric", "mib_light_point", "mib_light_spot", "mib_lightmap_sample", "mib_lightmap_write", "mib_lookup_background", "mib_lookup_cube1", "mib_lookup_cube6", "mib_lookup_cylindrical", "mib_lookup_spherical", "mib_opacity", "mib_passthrough_bump_map", "mib_photon_basic", "mib_ray_marcher", "mib_reflect", "mib_refract", "mib_refraction_index", "mib_shadow_transparency", "mib_texture_checkerboard", "mib_texture_filter_lookup", "mib_texture_lookup", "mib_texture_lookup2", "mib_texture_polkadot", "mib_texture_polkasphere", "mib_texture_remap", "mib_texture_rotate", "mib_texture_turbulence", "mib_texture_vector", "mib_texture_wave", "mib_transparency", "mib_twosided", "mib_volume", "misss_call_shader", "misss_fast_lmap_maya", "misss_fast_shader", "misss_fast_shader_x", "misss_fast_shader_x_passes", "misss_fast_simple_maya", "misss_fast_skin_maya", "misss_lambert_gamma", "misss_lightmap_write", "misss_physical", "misss_set_normal", "misss_skin_specular", "mixture", "mountain", "multilisterLight", "multiplyDivide", "noise", "ocean", "oceanShader", "oldPlace3dTx", "opticalFX", "oversampling_lens", "parti_volume", "particleAgeMapper", "particleCloud", "particleColorMapper", "particleIncandMapper", "particleSamplerInfo", "particleTranspMapper", "path_material", "phong", "phongE", "phongNode", "physical_lens_dof", "physical_light", "place2dTexture", "place3dTexture", "pluginShader", "plusMinusAverage", "pointLight", "postProcessList", "primerMaterial", "projection", "psdFileTex", "quadShadingSwitch", "quadSwitch", "ramp", "rampShader", "reflect", "remapColor", "remapHsv", "remapValue", "renderAccessNode", "renderBox", "renderCone", "renderPlugin", "renderSphere", "renderUtilityList", "reverse", "rgbToHsv", "rock", "samplerInfo", "setRange", "shaderGlow", "shaderList", "shadingEngine", "shadingMap", "shadowMatte", "shiftNode", "simpleHwShader", "simpleVolumeShader", "singleShadingSwitch", "singleSwitch", "slopeShader", "snow", "solidChecker", "solidFractal", "solidNoise", "spotLight", "stencil", "stucco", "surfaceLuminance", "surfaceShader", "texture2d", "texture3d", "transmat", "transmat_photon", "tripleShadingSwitch", "tripleSwitch", "useBackground", "vectorProduct", "volumeFog", "volumeLight", "volumeNode", "volumeNoise", "volumeShader", "water", "wood", "woodGrain"}; global proc int hasSwatch( string $node ) // // Description: // Returns true if the given node type is known to have a swatch // // Inputs: // $nodeType : node type // // Return Value: // true iff node type has a swatch // { global string $gTypesWithSwatch[]; string $nodeType = `nodeType $node`; return( stringArrayContains( $nodeType, $gTypesWithSwatch ) ); }