// =========================================================================== // 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. // =========================================================================== // // // Creation Date: July, 1998 // // Description: // This script contains code to set the values for the layout // controls for the given clip effect selected from the Dynamics // Clip Effects menu. The values are obtained from the option vars. // // // ================ dynSetClipEffectsOptionControls ================ // // SYNOPSIS // Set the specified sprite clip effect option box controls. // // INPUT ARGUMENTS // string $theClipEffect the name of the clip effect to set controls for // string $parent the parent layout // int $setFactorySettings whether to use default settings. // // global proc dynSetClipEffectsOptionControls(string $theClipEffect, string $parent, int $setFactorySettings) { if (!isValidClipEffect($theClipEffect)) return; string $procName = ("set"+$theClipEffect+"Controls"); eval ($procName+" "+$parent+" "+$setFactorySettings); } // ================ dynSetSmokeControls ================ // // SYNOPSIS // Set the moke sprite clip effect option box controls. // // INPUT ARGUMENTS // string $theClipEffect the name of the clip effect to set controls for // string $parent the parent layout // global proc setSmokeControls (string $parent, int $setFactorySettings) { // Retrieve the option settings // dynSetClipEffectsOptionVars( "Smoke", $setFactorySettings ); setParent $parent; // Query the optionVar and set the values into the controls // // The image controls. // textFieldGrp -e -text `optionVar -query smokeImageName` smokeImageName; checkBoxGrp -e -v1 `optionVar -query smokeCycleImages` smokeCycleImages; intFieldGrp -e -v1 `optionVar -query smokeStartImage` smokeStartImage; intFieldGrp -e -v1 `optionVar -query smokeEndImage` smokeEndImage; // The smoke particle controls. // textFieldGrp -e -text `optionVar -query smokeParticleName` smokeParticleName; floatSliderGrp -e -v `optionVar -query smokeMinLifespan` smokeMinLifespan; floatSliderGrp -e -v `optionVar -query smokeMaxLifespan` smokeMaxLifespan; floatSliderGrp -e -v `optionVar -query smokeThreshold` smokeThreshold; floatSliderGrp -e -v `optionVar -query smokeOpacity` smokeOpacity; // The smoke emission controls. // textFieldGrp -e -text `optionVar -query smokeEmitterName` smokeEmitterName; floatSliderGrp -e -v `optionVar -query smokeEmissionRate` smokeEmissionRate; floatSliderGrp -e -v `optionVar -query smokeEmissionSpread` smokeEmissionSpread; floatSliderGrp -e -v `optionVar -query smokeEmissionSpeed` smokeEmissionSpeed; floatSliderGrp -e -v `optionVar -query smokeEmissionDirX` smokeEmissionDirX; floatSliderGrp -e -v `optionVar -query smokeEmissionDirY` smokeEmissionDirY; floatSliderGrp -e -v `optionVar -query smokeEmissionDirZ` smokeEmissionDirZ; // The smoke turbulence controls. // checkBoxGrp -e -v1 `optionVar -query smokeUseTurbulence` smokeMotionForces; textFieldGrp -e -text `optionVar -query smokeTurbulenceName` smokeTurbulenceName; floatSliderGrp -e -v `optionVar -query smokeTurbulenceMagnitude` smokeTurbulenceMagnitude; floatSliderGrp -e -v `optionVar -query smokeTurbulenceFrequency` smokeTurbulenceFrequency; floatSliderGrp -e -v `optionVar -query smokeTurbulenceAttenuation` smokeTurbulenceAttenuation; } // ================ dynSetFireControls ================ // // SYNOPSIS // Set the fire clip effect option box controls. // // INPUT ARGUMENTS // string $theClipEffect the name of the clip effect to set controls for // string $parent the parent layout // global proc setFireControls (string $parent, int $setFactorySettings) { // Retrieve the option settings // dynSetClipEffectsOptionVars( "Fire", $setFactorySettings ); setParent $parent; // Query the optionVars and set ther values into the controls // // The fire particle controls. // textFieldGrp -e -text `optionVar -query fireObject` fireObject; textFieldGrp -e -text `optionVar -query fireParticleName` fireParticleName; // The fire emission type control. // int $type = `optionVar -query fireEmissionTypeOV`; optionMenuGrp -e -sl `optionVar -query fireEmissionTypeOV` fireEmissionTypeOM; // The fire emission controls. // floatSliderGrp -e -v `optionVar -query fireDensity` fireDensity; floatSliderGrp -e -v `optionVar -query fireStartRadius` fireStartRadius; floatSliderGrp -e -v `optionVar -query fireEndRadius` fireEndRadius; floatSliderGrp -e -v `optionVar -query fireIntensity` fireIntensity; floatSliderGrp -e -v `optionVar -query fireSpread` fireSpread; floatSliderGrp -e -v `optionVar -query fireScale` fireScale; // The fire turbulence controls. // floatSliderGrp -e -v `optionVar -query fireTurbulence` fireTurbulence; // The fire gravity controls. // floatSliderGrp -e -v `optionVar -query fireSpeed` fireSpeed; floatSliderGrp -e -v `optionVar -query fireDirectionX` fireDirectionX; floatSliderGrp -e -v `optionVar -query fireDirectionY` fireDirectionY; floatSliderGrp -e -v `optionVar -query fireDirectionZ` fireDirectionZ; // Enable/disable the spread control depending on the emitter type. // dynClipEffectsEmitterOptionChoice($parent); } // ================ dynSetFlowControls ================ // // SYNOPSIS // Set the flow-along-curves clip effect option box controls. // // INPUT ARGUMENTS // string $theClipEffect the name of the clip effect to set controls for // string $parent the parent layout // global proc setFlowControls (string $parent, int $setFactorySettings) { // Retrieve the option settings // dynSetClipEffectsOptionVars( "Flow", $setFactorySettings ); setParent $parent; // Query the optionVars and set their values into the controls // // The flow object controls. // textFieldGrp -e -text `optionVar -query flowObject` flowObject; // The flow creation controls. // checkBoxGrp -e -v1 `optionVar -query flowAttachEmitter` flowAttachEmitter; intSliderGrp -e -v `optionVar -query flowNumControlSegs` flowNumControlSegs; intSliderGrp -e -v `optionVar -query flowNumControlSubsegs` flowNumControlSubsegs; // The flow attribute controls. // floatSliderGrp -e -v `optionVar -query flowEmitterRate` flowEmitterRate; floatSliderGrp -e -v `optionVar -query flowRandomMotion` flowRandomMotion; floatSliderGrp -e -v `optionVar -query flowLifespan` flowLifespan; floatSliderGrp -e -v `optionVar -query flowGoalWeight` flowGoalWeight; } // ================ setSurfaceFlowControls ================ // // SYNOPSIS // Set the flow-along-surface clip effect option box controls. // // INPUT ARGUMENTS // string $theClipEffect the name of the clip effect to set controls for // string $parent the parent layout // global proc setSurfaceFlowControls (string $parent, int $setFactorySettings) { // Retrieve the option settings // dynSetClipEffectsOptionVars( "SurfaceFlow", $setFactorySettings ); setParent $parent; // Query the optionVars and set their values into the controls // // The flow object controls. // textFieldGrp -e -text `optionVar -query surfaceFlowObject` surfaceFlowObject; // The flow creation controls. // checkBoxGrp -e -v1 `optionVar -query surfaceFlowCreateParticle` surfaceFlowCreateParticle; checkBoxGrp -e -v1 `optionVar -query surfaceFlowCreateParticleForEachFlow` surfaceFlowCreateParticleForEachFlow; optionMenuGrp -e -sl `optionVar -query surfaceFlowManipTypeId` surfaceFlowManipType; intSliderGrp -e -v `optionVar -query surfaceFlowControlResolution` surfaceFlowControlResolution; intSliderGrp -e -v `optionVar -query surfaceFlowSubControlResolution` surfaceFlowSubControlResolution; intSliderGrp -e -v `optionVar -query surfaceFlowManipulatorResolution` surfaceFlowManipulatorResolution; // The flow attribute controls. // floatSliderGrp -e -v `optionVar -query surfaceFlowGoalWeight` surfaceFlowGoalWeight; floatSliderGrp -e -v `optionVar -query surfaceFlowEmitterRate` surfaceFlowEmitterRate; floatSliderGrp -e -v `optionVar -query surfaceFlowParticleLifespan` surfaceFlowParticleLifespan; floatSliderGrp -e -v `optionVar -query surfaceFlowMinAgeRatio` surfaceFlowMinAgeRatio; floatSliderGrp -e -v `optionVar -query surfaceFlowMaxAgeRatio` surfaceFlowMaxAgeRatio; } // ================ setDeleteSurfaceFlowControls ================ // // SYNOPSIS // Set the delete-surface-flow clip effect option box controls. // // INPUT ARGUMENTS // string $theClipEffect the name of the clip effect to set controls for // string $parent the parent layout // global proc setDeleteSurfaceFlowControls(string $parent,int $setFactorySettings) { // Retrieve the option settings // dynSetClipEffectsOptionVars( "DeleteSurfaceFlow", $setFactorySettings ); setParent $parent; radioButtonGrp -e -sl `optionVar -query deleteSurfaceFlow` deleteSurfaceFlow; radioButtonGrp -e -sl `optionVar -query removeParticlesFromSurfaceFlow` removeParticlesFromSurfaceFlow; checkBoxGrp -e -v1 `optionVar -query deleteSurfaceFlowParticles` deleteSurfaceFlowParticles; } // ================ setLightningControls ================ // // SYNOPSIS // Set the lightning clip effect option box controls. // // INPUT ARGUMENTS // string $theClipEffect the name of the clip effect to set controls for // string $parent the parent layout // global proc setLightningControls (string $parent, int $setFactorySettings) { // Retrieve the option settings // dynSetClipEffectsOptionVars( "Lightning", $setFactorySettings ); setParent $parent; // The lightning object controls. // textFieldGrp -e -text `optionVar -query lightningObject` lightningObject; // The lightning creation controls. // checkBoxGrp -e -v1 `optionVar -query lightningGrouping` lightningGrouping; radioButtonGrp -e -sl `optionVar -query lightningCreateOptions` lightningCreateOptions; intSliderGrp -e -v `optionVar -query lightningCurveSegments` lightningCurveSegments; // The lightning attribute controls. // floatSliderGrp -e -v `optionVar -query lightningThickness` lightningThickness; floatSliderGrp -e -v `optionVar -query lightningMaxSpread` lightningMaxSpread; floatSliderGrp -e -v `optionVar -query lightningStart` lightningStart; floatSliderGrp -e -v `optionVar -query lightningEnd` lightningEnd; floatSliderGrp -e -v `optionVar -query lightningGlowIntensity` lightningGlowIntensity; } // ================ dynSetMeltControls ================ // // SYNOPSIS // Set the melt clip effect option box controls. // // INPUT ARGUMENTS // string $theClipEffect the name of the clip effect to set controls for // string $parent the parent layout // global proc setMeltControls (string $parent, int $setFactorySettings) { // Retrieve the option settings // dynSetClipEffectsOptionVars( "Melt", $setFactorySettings ); setParent $parent; // Query the optionVars and set their values into the controls // // The melt controls. // textFieldGrp -e -text `optionVar -query meltObject` meltObject; textFieldGrp -e -text `optionVar -query meltOnObject` meltOnObject; // The melt controls. // floatSliderGrp -e -v `optionVar -query meltSpeed` meltSpeed; floatSliderGrp -e -v `optionVar -query meltSpread` meltSpread; floatSliderGrp -e -v `optionVar -query meltDistortion` meltDistortion; floatSliderGrp -e -v `optionVar -query meltDirectionX` meltDirectionX; floatSliderGrp -e -v `optionVar -query meltDirectionY` meltDirectionY; floatSliderGrp -e -v `optionVar -query meltDirectionZ` meltDirectionZ; checkBoxGrp -e -v1 `optionVar -query meltUseLatticeRes` meltUseLatticeRes; floatSliderGrp -e -v `optionVar -query meltLatticeResX` meltLatticeResX; floatSliderGrp -e -v `optionVar -query meltLatticeResY` meltLatticeResY; floatSliderGrp -e -v `optionVar -query meltLatticeResZ` meltLatticeResZ; // Enable/disable the control resolution controls depending on the // value of the use checkbox // int $isOn = `checkBoxGrp -q -v1 meltUseLatticeRes`; dynEnableLatticeResCB($parent, $isOn); } // ================ dynSetFireworksControls ================ // // SYNOPSIS // Set the fireworks clip effect option box controls. // // INPUT ARGUMENTS // string $theClipEffect the name of the clip effect to set controls for // string $parent the parent layout // global proc setFireworksControls (string $parent, int $setFactorySettings) { // Retrieve the option settings // dynSetClipEffectsOptionVars( "Fireworks", $setFactorySettings ); setParent $parent; // Query the optionVars and set their values into the controls // // The fireworks controls. // textFieldGrp -e -text `optionVar -query fireworksName` fireworksName; intSliderGrp -e -v `optionVar -query fwNumRockets` fwNumRockets; floatSliderGrp -e -v `optionVar -query fwLaunchPositionX` fwLaunchPositionX; floatSliderGrp -e -v `optionVar -query fwLaunchPositionY` fwLaunchPositionY; floatSliderGrp -e -v `optionVar -query fwLaunchPositionZ` fwLaunchPositionZ; floatSliderGrp -e -v `optionVar -query fwBurstPosCenterX` fwBurstPosCenterX; floatSliderGrp -e -v `optionVar -query fwBurstPosCenterY` fwBurstPosCenterY; floatSliderGrp -e -v `optionVar -query fwBurstPosCenterZ` fwBurstPosCenterZ; floatSliderGrp -e -v `optionVar -query fwBurstExtentsX` fwBurstExtentsX; floatSliderGrp -e -v `optionVar -query fwBurstExtentsY` fwBurstExtentsY; floatSliderGrp -e -v `optionVar -query fwBurstExtentsZ` fwBurstExtentsZ; floatSliderGrp -e -v `optionVar -query fwFirstLaunchFrame` fwFirstLaunchFrame; floatSliderGrp -e -v `optionVar -query fwLaunchRate` fwLaunchRate; floatSliderGrp -e -v `optionVar -query fwMinFlightTime` fwMinFlightTime; floatSliderGrp -e -v `optionVar -query fwMaxFlightTime` fwMaxFlightTime; floatSliderGrp -e -v `optionVar -query fwMaxBurstSpeed` fwMaxBurstSpeed; floatSliderGrp -e -v `optionVar -query fwTrailRate` fwTrailRate; floatSliderGrp -e -v `optionVar -query fwTrailSpeed` fwTrailSpeed; floatSliderGrp -e -v `optionVar -query fwTrailSpread` fwTrailSpread; floatSliderGrp -e -v `optionVar -query fwMinTrailTailSize` fwMinTrailTailSize; floatSliderGrp -e -v `optionVar -query fwMaxTrailTailSize` fwMaxTrailTailSize; checkBoxGrp -e -v1 `optionVar -query fwTrailSetUserColor` fwTrailSetUserColor; textFieldGrp -e -text `optionVar -query fwTrailColorCreationProc` fwTrailColorCreationProc; intSliderGrp -e -v `optionVar -query fwTrailNumColors` fwTrailNumColors; floatSliderGrp -e -v `optionVar -query fwTrailGlowIntensity` fwTrailGlowIntensity; floatSliderGrp -e -v `optionVar -query fwTrailIncanIntensity` fwTrailIncanIntensity; floatSliderGrp -e -v `optionVar -query fwMinSparksCount` fwMinSparksCount; floatSliderGrp -e -v `optionVar -query fwMaxSparksCount` fwMaxSparksCount; floatSliderGrp -e -v `optionVar -query fwMinSparksTailSize` fwMinSparksTailSize; floatSliderGrp -e -v `optionVar -query fwMaxSparksTailSize` fwMaxSparksTailSize; checkBoxGrp -e -v1 `optionVar -query fwSparksSetUserColor` fwSparksSetUserColor; textFieldGrp -e -text `optionVar -query fwSparksColorCreationProc` fwSparksColorCreationProc; intSliderGrp -e -v `optionVar -query fwSparksNumColors` fwSparksNumColors; intSliderGrp -e -v `optionVar -query fwSparksColorSpread` fwSparksColorSpread; floatSliderGrp -e -v `optionVar -query fwSparksGlowIntensity` fwSparksGlowIntensity; floatSliderGrp -e -v `optionVar -query fwSparksIncanIntensity` fwSparksIncanIntensity; // Enable/disable the random color creation controls depending on // the /value of the random checkbox // int $isOn = `checkBoxGrp -q -v1 fwTrailSetUserColor`; fwTrailSetUserColorProcCB($parent, $isOn); $isOn = `checkBoxGrp -q -v1 fwSparksSetUserColor`; fwSparksSetUserColorProcCB($parent, $isOn); } // ================ setShatterControls ================ // // SYNOPSIS // Set the shatter clip effect option box controls. // // INPUT ARGUMENTS // string $theClipEffect the name of the clip effect to set controls for // string $parent the parent layout // global proc setShatterControls (string $parent, int $setFactorySettings) { setParent $parent; dynSetClipEffectsOptionVars( "Shatter", $setFactorySettings ); string $shatterTypeValue = `optionVar -query shatterType`; // Make sure the tab is set properly. // if ( `tabLayout -exists shatterTabLayout` ) { tabLayout -e -selectTab $shatterTypeValue shatterTabLayout; } if ( $setFactorySettings ) { if ( $shatterTypeValue == "shatterSurfaceTab" ) { setSurfaceShatterControls( $parent ); } else if ( $shatterTypeValue == "shatterSolidTab" ) { setSolidShatterControls( $parent ); } else if ( $shatterTypeValue == "shatterCrackTab" ) { setCrackShatterControls( $parent ); } } else { setSurfaceShatterControls( $parent ); setSolidShatterControls( $parent ); setCrackShatterControls( $parent ); } } // ================ setSurfaceShatterControls ================ // // SYNOPSIS // Set the shatter clip effect option box controls. // // INPUT ARGUMENTS // string $theClipEffect the name of the clip effect to set controls for // string $parent the parent layout // global proc setSurfaceShatterControls (string $parent ) { // Query the optionVar and set the values into the controls // textFieldGrp -e -text `optionVar -query shatterSurfaceName` shatterSurfaceName; intSliderGrp -e -v `optionVar -query shatterSurfaceShardCount` shatterSurfaceShardCount; // checkBoxGrp -e // -v1 `optionVar -query shatterSurfaceExactCount` // shatterExactCount; checkBoxGrp -e -v1 `optionVar -query shatterSurfaceSmoothing` shatterSurfaceSmoothing; floatSliderGrp -e -v `optionVar -query shatterSurfaceExtrude` shatterSurfaceExtrude; checkBoxGrp -e -v1 `optionVar -query shatterSurfaceTriangulate` shatterSurfaceTriangulate; // floatSliderGrp -e // -v `optionVar -query shatterSurfaceEdgePerturbation` // shatterSurfaceEdgePerturbation; optionMenuGrp -e -sl `optionVar -query shatterSurfacePostOp` shatterSurfacePostOperation; checkBoxGrp -e -v1 `optionVar -query shatterSurfaceVerbose` shatterSurfaceVerbose; int $originalSurface = `optionVar -query shatterSurfaceOriginal`; if ( $originalSurface > 3 ) { $originalSurface -= 3; radioButtonGrp -e -select $originalSurface shatterSurfaceOriginal1; } else { radioButtonGrp -e -select $originalSurface shatterSurfaceOriginal; } checkBoxGrp -e -v1 `optionVar -query shatterSurfaceMakeRigidBody` shatterSurfaceMakeRigidBody; intSliderGrp -e -v `optionVar -query shatterSurfaceSeedValue` shatterSurfaceSeedValue; } // ================ setSolidShatterControls ================ // // SYNOPSIS // Set the solid shatter clip effect option box controls. // // INPUT ARGUMENTS // string $theClipEffect the name of the clip effect to set controls for // string $parent the parent layout // global proc setSolidShatterControls (string $parent ) { // Query the optionVar and set the values into the controls // textFieldGrp -e -text `optionVar -query shatterSolidName` shatterSolidName; intSliderGrp -e -v `optionVar -query shatterSolidShardCount` shatterSolidShardCount; checkBoxGrp -e -v1 `optionVar -query shatterSolidTriangulate` shatterSolidTriangulate; checkBoxGrp -e -v1 `optionVar -query shatterSolidInteriorMaterial` shatterSolidInteriorMaterial; int $removeInterior = `optionVar -query shatterSolidRemoveInterior`; checkBoxGrp -e // -v1 `optionVar -query shatterSolidRemoveInterior` -v1 $removeInterior shatterSolidRemoveInterior; floatSliderGrp -e -v `optionVar -query shatterSolidExtrude` -enable $removeInterior shatterSolidExtrude; floatSliderGrp -e -v `optionVar -query shatterSolidEdgePerturbation` shatterSolidEdgePerturbation; optionMenuGrp -e -sl `optionVar -query shatterSolidPostOp` shatterSolidPostOperation; checkBoxGrp -e -v1 `optionVar -query shatterSolidVerbose` shatterSolidVerbose; int $originalSurface = `optionVar -query shatterSolidOriginal`; if ( $originalSurface > 3 ) { $originalSurface -= 3; radioButtonGrp -e -select $originalSurface shatterSolidOriginal1; } else { radioButtonGrp -e -select $originalSurface shatterSolidOriginal; } checkBoxGrp -e -v1 `optionVar -query shatterSolidMakeRigidBody` shatterSolidMakeRigidBody; intSliderGrp -e -v `optionVar -query shatterSolidSeedValue` shatterSolidSeedValue; } // ================ setCrackShatterControls ================ // // SYNOPSIS // Set the shatter clip effect option box controls. // // INPUT ARGUMENTS // string $theClipEffect the name of the clip effect to set controls for // string $parent the parent layout // global proc setCrackShatterControls (string $parent ) { // Query the optionVar and set the values into the controls // textFieldGrp -e -text `optionVar -query shatterCrackName` shatterCrackName; intSliderGrp -e -v `optionVar -query shatterCrackCount` shatterCrackCount; intSliderGrp -e -v `optionVar -query shatterCrackLength` shatterCrackLength; floatSliderGrp -e -v `optionVar -query shatterCrackExtrude` shatterCrackExtrude; checkBoxGrp -e -v1 `optionVar -query shatterCrackTriangulate` shatterCrackTriangulate; floatSliderGrp -e -v `optionVar -query shatterCrackEdgePerturbation` shatterCrackEdgePerturbation; optionMenuGrp -e -sl `optionVar -query shatterCrackPostOp` shatterCrackPostOperation; checkBoxGrp -e -v1 `optionVar -query shatterCrackVerbose` shatterCrackVerbose; int $originalSurface = `optionVar -query shatterCrackOriginal`; if ( $originalSurface > 3 ) { $originalSurface -= 3; radioButtonGrp -e -select $originalSurface shatterCrackOriginal1; } else { radioButtonGrp -e -select $originalSurface shatterCrackOriginal; } checkBoxGrp -e -v1 `optionVar -query shatterCrackMakeRigidBody` shatterCrackMakeRigidBody; intSliderGrp -e -v `optionVar -query shatterCrackSeedValue` shatterCrackSeedValue; }