// =========================================================================== // 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 the callbacks for the Dynamics Effects menus (if // no option box is requested) and the "Create" // buttons of the Dynamics option boxes. Each callback sets // the option vars from the controls, then calls // performDynamicsClipEffects() to execute the command. // // // // ================ dynApplyClipEffectsCallback ================ // // SYNOPSIS // Callback for the "Create" button for the specified clip effect. // // INPUT ARGUMENTS // string $theClipEffect the clip effect selected // int $parent the parent layout // int $executeCmd whether to execute the clip effect command // // global proc dynApplyClipEffectsCallback(string $theClipEffect, string $parent, int $executeCmd ) { if (!isValidClipEffect($theClipEffect)) return; string $procName = ("apply"+$theClipEffect+"Callback"); eval ($procName+" "+$parent + " " + $executeCmd); } // // ================ appplySmokeCallback ================ // // SYNOPSIS // Callback for the "Create" button for the smoke clip effect. // // INPUT ARGUMENTS // int $parent the parent layout // int $executeCmd whether to execute the clip effect command // // global proc applySmokeCallback (string $parent, int $executeCmd) // // Description: // Set the optionVar from the control values, and then execute the command, // if so required. // { setParent $parent; // Option vars for the sprite image attributes. // optionVar -stringValue smokeImageName `textFieldGrp -q -text smokeImageName`; optionVar -intValue smokeCycleImages `checkBoxGrp -q -v1 smokeCycleImages`; optionVar -intValue smokeStartImage `intFieldGrp -q -v1 smokeStartImage`; optionVar -intValue smokeEndImage `intFieldGrp -q -v1 smokeEndImage`; // optionVars for the smoke particle optionVars. // optionVar -stringValue smokeParticleName `textFieldGrp -q -text smokeParticleName`; optionVar -floatValue smokeMinLifespan `floatSliderGrp -q -v smokeMinLifespan`; optionVar -floatValue smokeMaxLifespan `floatSliderGrp -q -v smokeMaxLifespan`; optionVar -floatValue smokeThreshold `floatSliderGrp -q -v smokeThreshold`; optionVar -floatValue smokeOpacity `floatSliderGrp -q -v smokeOpacity`; // optionVars for the smoke emission optionVars. // optionVar -stringValue smokeEmitterName `textFieldGrp -q -text smokeEmitterName`; optionVar -floatValue smokeEmissionRate `floatSliderGrp -q -v smokeEmissionRate`; optionVar -floatValue smokeEmissionSpread `floatSliderGrp -q -v smokeEmissionSpread`; optionVar -floatValue smokeEmissionSpeed `floatSliderGrp -q -v smokeEmissionSpeed`; optionVar -floatValue smokeEmissionDirX `floatSliderGrp -q -v smokeEmissionDirX`; optionVar -floatValue smokeEmissionDirY `floatSliderGrp -q -v smokeEmissionDirY`; optionVar -floatValue smokeEmissionDirZ `floatSliderGrp -q -v smokeEmissionDirZ`; // optionVars for the turbulence field optionVars. // optionVar -intValue smokeUseTurbulence `checkBoxGrp -q -v1 smokeMotionForces`; optionVar -stringValue smokeTurbulenceName `textFieldGrp -q -text smokeTurbulenceName`; optionVar -floatValue smokeTurbulenceMagnitude `floatSliderGrp -q -v smokeTurbulenceMagnitude`; optionVar -floatValue smokeTurbulenceFrequency `floatSliderGrp -q -v smokeTurbulenceFrequency`; optionVar -floatValue smokeTurbulenceAttenuation `floatSliderGrp -q -v smokeTurbulenceAttenuation`; if ($executeCmd) { performDynamicsClipEffects "Smoke" 0; string $tmpCmd = "performDynamicsClipEffects \"Smoke\" 0"; addToRecentCommandQueue $tmpCmd "Smoke"; } } // // ================ applyFireCallback ================ // // SYNOPSIS // Callback for the "Create" button for the fire clip effect. // // INPUT ARGUMENTS // int $parent the parent layout // int $executeCmd whether to execute the clip effect command // // global proc applyFireCallback (string $parent, int $executeCmd) // // Description: // Set the optionVar from the control values, and then execute the command, // if so required. // { setParent $parent; // Fire object and fire particle names. // optionVar -stringValue fireObject `textFieldGrp -q -text fireObject`; optionVar -stringValue fireParticleName `textFieldGrp -q -text fireParticleName`; // Fire emitter type. // optionVar -intValue fireEmissionTypeOV `optionMenuGrp -q -sl fireEmissionTypeOM`; // Fire attributes. // optionVar -floatValue fireDensity `floatSliderGrp -q -v fireDensity`; optionVar -floatValue fireStartRadius `floatSliderGrp -q -v fireStartRadius`; optionVar -floatValue fireEndRadius `floatSliderGrp -q -v fireEndRadius`; optionVar -floatValue fireIntensity `floatSliderGrp -q -v fireIntensity`; optionVar -floatValue fireSpread `floatSliderGrp -q -v fireSpread`; optionVar -floatValue fireScale `floatSliderGrp -q -v fireScale`; optionVar -floatValue fireTurbulence`floatSliderGrp -q -v fireTurbulence`; optionVar -floatValue fireSpeed `floatSliderGrp -q -v fireSpeed`; // Fire direction. // optionVar -floatValue fireDirectionX `floatSliderGrp -q -v fireDirectionX`; optionVar -floatValue fireDirectionY `floatSliderGrp -q -v fireDirectionY`; optionVar -floatValue fireDirectionZ `floatSliderGrp -q -v fireDirectionZ`; if ($executeCmd) { performDynamicsClipEffects "Fire" 0; string $tmpCmd = "performDynamicsClipEffects \"Fire\" 0"; addToRecentCommandQueue $tmpCmd "Fire"; } } // ================ applyFlowCallback ================ // // SYNOPSIS // Callback for the "Create" button for the flow-along-curves clip effect. // Set the optionVars from the control values, and then execute // the command, if so requested. // // INPUT ARGUMENTS // int $parent the parent layout // int $executeCmd whether to execute the clip effect command // // global proc applyFlowCallback (string $parent, int $executeCmd) // // Description: // { setParent $parent; // Flow object name. // optionVar -stringValue flowObject `textFieldGrp -q -text flowObject`; // Flow creation controls. // optionVar -intValue flowAttachEmitter `checkBoxGrp -q -v1 flowAttachEmitter`; optionVar -intValue flowNumControlSegs `intSliderGrp -q -v flowNumControlSegs`; optionVar -intValue flowNumControlSubsegs `intSliderGrp -q -v flowNumControlSubsegs`; // Flow attribute controls. // optionVar -floatValue flowEmitterRate `floatSliderGrp -q -v flowEmitterRate`; optionVar -floatValue flowRandomMotion `floatSliderGrp -q -v flowRandomMotion`; optionVar -floatValue flowLifespan `floatSliderGrp -q -v flowLifespan`; optionVar -floatValue flowGoalWeight `floatSliderGrp -q -v flowGoalWeight`; if ($executeCmd) { performDynamicsClipEffects "Flow" 0; string $tmpCmd = "performDynamicsClipEffects \"Flow\" 0"; addToRecentCommandQueue $tmpCmd "Flow"; } } // ================ applySurfaceFlowCallback ================ // // SYNOPSIS // Callback for the "Create" button for flow-along-surface clip effect. // Set the optionVars from the control values, and then execute // the command, if so requested. // // INPUT ARGUMENTS // int $parent the parent layout // int $executeCmd whether to execute the clip effect command // global proc applySurfaceFlowCallback (string $parent, int $executeCmd) { setParent $parent; // Flow object name. // optionVar -stringValue surfaceFlowObject `textFieldGrp -q -text surfaceFlowObject`; // Flow creation controls. // optionVar -intValue surfaceFlowCreateParticle `checkBoxGrp -q -v1 surfaceFlowCreateParticle`; optionVar -intValue surfaceFlowCreateParticleForEachFlow `checkBoxGrp -q -v1 surfaceFlowCreateParticleForEachFlow`; optionVar -intValue surfaceFlowManipTypeId `optionMenuGrp -query -sl surfaceFlowManipType`; optionVar -intValue surfaceFlowControlResolution `intSliderGrp -q -v surfaceFlowControlResolution`; optionVar -intValue surfaceFlowSubControlResolution `intSliderGrp -q -v surfaceFlowSubControlResolution`; optionVar -intValue surfaceFlowManipulatorResolution `intSliderGrp -q -v surfaceFlowManipulatorResolution`; // Flow attribute controls. // optionVar -floatValue surfaceFlowGoalWeight `floatSliderGrp -q -v surfaceFlowGoalWeight`; optionVar -floatValue surfaceFlowEmitterRate `floatSliderGrp -q -v surfaceFlowEmitterRate`; optionVar -floatValue surfaceFlowParticleLifespan `floatSliderGrp -q -v surfaceFlowParticleLifespan`; optionVar -floatValue surfaceFlowMinAgeRatio `floatSliderGrp -q -v surfaceFlowMinAgeRatio`; optionVar -floatValue surfaceFlowMaxAgeRatio `floatSliderGrp -q -v surfaceFlowMaxAgeRatio`; if ($executeCmd) { performDynamicsClipEffects "SurfaceFlow" 0; string $tmpCmd = "performDynamicsClipEffects \"SurfaceFlow\" 0"; addToRecentCommandQueue $tmpCmd "SurfaceFlow"; } } // ================ applyDeleteSurfaceFlowCallback ================ // // SYNOPSIS // Callback for the "Delete" button for deleting surface flow clip effect. // Set the optionVars from the control values, and then execute // the command, if so requested. // // INPUT ARGUMENTS // int $parent the parent layout // int $executeCmd whether to execute the clip effect command // global proc applyDeleteSurfaceFlowCallback(string $parent, int $executeCmd) { setParent $parent; optionVar -intValue deleteSurfaceFlow `radioButtonGrp -q -sl deleteSurfaceFlow`; optionVar -intValue removeParticlesFromSurfaceFlow `radioButtonGrp -q -sl removeParticlesFromSurfaceFlow`; optionVar -intValue deleteSurfaceFlowParticles `checkBoxGrp -q -v1 deleteSurfaceFlowParticles`; if ($executeCmd) { performDynamicsClipEffects "DeleteSurfaceFlow" 0; string $tmpCmd = "performDynamicsClipEffects \"DeleteSurfaceFlow\" 0"; addToRecentCommandQueue $tmpCmd "DeleteSurfaceFlow"; } } // ================ applyLightningCallback ================ // // SYNOPSIS // Callback for the "Create" button for lightning clip effect. // Set the optionVars from the control values, and then execute // the command, if so requested. // // INPUT ARGUMENTS // int $parent the parent layout // int $executeCmd whether to execute the clip effect command // global proc applyLightningCallback(string $parent, int $executeCmd) { setParent $parent; // Lightning object name. // optionVar -stringValue lightningObject `textFieldGrp -q -text lightningObject`; // Flow creation controls. // optionVar -intValue lightningGrouping `checkBoxGrp -q -v1 lightningGrouping`; optionVar -intValue lightningCreateOptions `radioButtonGrp -q -sl lightningCreateOptions`; optionVar -intValue lightningCurveSegments `intSliderGrp -q -v lightningCurveSegments`; // Flow attribute controls. // optionVar -floatValue lightningThickness `floatSliderGrp -q -v lightningThickness`; optionVar -floatValue lightningMaxSpread `floatSliderGrp -q -v lightningMaxSpread`; optionVar -floatValue lightningStart `floatSliderGrp -q -v lightningStart`; optionVar -floatValue lightningEnd `floatSliderGrp -q -v lightningEnd`; optionVar -floatValue lightningGlowIntensity `floatSliderGrp -q -v lightningGlowIntensity`; if ($executeCmd) { performDynamicsClipEffects "Lightning" 0; string $tmpCmd = "performDynamicsClipEffects \"Lightning\" 0"; addToRecentCommandQueue $tmpCmd "Lightning"; } } // ================ applyMeltCallback ================ // // SYNOPSIS // Callback for the "Create" button for the melt clip effect. // Set the optionVars from the control values, and then execute // the command, if so requested. // // INPUT ARGUMENTS // int $parent the parent layout // int $executeCmd whether to execute the clip effect command // // global proc applyMeltCallback (string $parent, int $executeCmd) // // Description: // { setParent $parent; // Melt object and melt-on object names. // optionVar -stringValue meltObject `textFieldGrp -q -text meltObject`; optionVar -stringValue meltOnObject `textFieldGrp -q -text meltOnObject`; // Melt attributes. // optionVar -floatValue meltSpeed `floatSliderGrp -q -v meltSpeed`; optionVar -floatValue meltSpread `floatSliderGrp -q -v meltSpread`; optionVar -floatValue meltDistortion `floatSliderGrp -q -v meltDistortion`; // Melt direction. // optionVar -floatValue meltDirectionX `floatSliderGrp -q -v meltDirectionX`; optionVar -floatValue meltDirectionY `floatSliderGrp -q -v meltDirectionY`; optionVar -floatValue meltDirectionZ `floatSliderGrp -q -v meltDirectionZ`; // Melt control resolution. // optionVar -intValue meltUseLatticeRes `checkBoxGrp -q -v1 meltUseLatticeRes`; optionVar -floatValue meltLatticeResX `floatSliderGrp -q -v meltLatticeResX`; optionVar -floatValue meltLatticeResY `floatSliderGrp -q -v meltLatticeResY`; optionVar -floatValue meltLatticeResZ `floatSliderGrp -q -v meltLatticeResZ`; if ($executeCmd) { performDynamicsClipEffects "Melt" 0; string $tmpCmd = "performDynamicsClipEffects \"Melt\" 0"; addToRecentCommandQueue $tmpCmd "Melt"; } } // ================ applyFireworksCallback ================ // // SYNOPSIS // Callback for the "Create" button for the fireworks clip effect. // Set the optionVars from the control values, and then execute // the command, if so requested. // // INPUT ARGUMENTS // int $parent the parent layout // int $executeCmd whether to execute the clip effect command // // global proc applyFireworksCallback (string $parent, int $executeCmd) // // Description: // { setParent $parent; // Fireworks name. // optionVar -stringValue fireworksName `textFieldGrp -q -text fireworksName`; optionVar -intValue fwNumRockets `intSliderGrp -q -v fwNumRockets`; optionVar -floatValue fwLaunchPositionX `floatSliderGrp -q -v fwLaunchPositionX`; optionVar -floatValue fwLaunchPositionY `floatSliderGrp -q -v fwLaunchPositionY`; optionVar -floatValue fwLaunchPositionZ `floatSliderGrp -q -v fwLaunchPositionZ`; optionVar -floatValue fwBurstPosCenterX `floatSliderGrp -q -v fwBurstPosCenterX`; optionVar -floatValue fwBurstPosCenterY `floatSliderGrp -q -v fwBurstPosCenterY`; optionVar -floatValue fwBurstPosCenterZ `floatSliderGrp -q -v fwBurstPosCenterZ`; optionVar -floatValue fwBurstExtentsX `floatSliderGrp -q -v fwBurstExtentsX`; optionVar -floatValue fwBurstExtentsY `floatSliderGrp -q -v fwBurstExtentsY`; optionVar -floatValue fwBurstExtentsZ `floatSliderGrp -q -v fwBurstExtentsZ`; optionVar -floatValue fwFirstLaunchFrame `floatSliderGrp -q -v fwFirstLaunchFrame`; optionVar -floatValue fwLaunchRate `floatSliderGrp -q -v fwLaunchRate`; optionVar -floatValue fwMinFlightTime `floatSliderGrp -q -v fwMinFlightTime`; optionVar -floatValue fwMaxFlightTime `floatSliderGrp -q -v fwMaxFlightTime`; optionVar -floatValue fwMaxBurstSpeed `floatSliderGrp -q -v fwMaxBurstSpeed`; optionVar -floatValue fwTrailRate `floatSliderGrp -q -v fwTrailRate`; optionVar -floatValue fwTrailSpeed `floatSliderGrp -q -v fwTrailSpeed`; optionVar -floatValue fwTrailSpread `floatSliderGrp -q -v fwTrailSpread`; optionVar -floatValue fwMinTrailTailSize `floatSliderGrp -q -v fwMinTrailTailSize`; optionVar -floatValue fwMaxTrailTailSize `floatSliderGrp -q -v fwMaxTrailTailSize`; optionVar -intValue fwTrailSetUserColor `checkBoxGrp -q -v1 fwTrailSetUserColor`; optionVar -stringValue fwTrailColorCreationProc `textFieldGrp -q -text fwTrailColorCreationProc`; optionVar -intValue fwTrailNumColors `intSliderGrp -q -v fwTrailNumColors`; optionVar -floatValue fwTrailGlowIntensity `floatSliderGrp -q -v fwTrailGlowIntensity`; optionVar -floatValue fwTrailIncanIntensity `floatSliderGrp -q -v fwTrailIncanIntensity`; optionVar -floatValue fwMinSparksCount `floatSliderGrp -q -v fwMinSparksCount`; optionVar -floatValue fwMaxSparksCount `floatSliderGrp -q -v fwMaxSparksCount`; optionVar -floatValue fwMinSparksTailSize `floatSliderGrp -q -v fwMinSparksTailSize`; optionVar -floatValue fwMaxSparksTailSize `floatSliderGrp -q -v fwMaxSparksTailSize`; optionVar -intValue fwSparksSetUserColor `checkBoxGrp -q -v1 fwSparksSetUserColor`; optionVar -stringValue fwSparksColorCreationProc `textFieldGrp -q -text fwSparksColorCreationProc`; optionVar -intValue fwSparksNumColors `intSliderGrp -q -v fwSparksNumColors`; optionVar -intValue fwSparksColorSpread `intSliderGrp -q -v fwSparksColorSpread`; optionVar -floatValue fwSparksGlowIntensity `floatSliderGrp -q -v fwSparksGlowIntensity`; optionVar -floatValue fwSparksIncanIntensity `floatSliderGrp -q -v fwSparksIncanIntensity`; if ($executeCmd) { performDynamicsClipEffects "Fireworks" 0; string $tmpCmd = "performDynamicsClipEffects \"Fireworks\" 0"; addToRecentCommandQueue $tmpCmd "Fireworks"; } } // ================ applyShatterCallback ================ // // SYNOPSIS // Callback for the "Create" button for the shatter clip effect. // // INPUT ARGUMENTS // int $parent the parent layout // int $executeCmd whether to execute the clip effect command // // global proc applyShatterCallback (string $parent, int $executeCmd) // // Description: // Set the optionVar from the control values, and then execute the command, // if so required. // { setParent $parent; string $shatterType = `tabLayout -q -selectTab shatterTabLayout`; optionVar -stringValue shatterType $shatterType; if ($shatterType == "shatterSurfaceTab" ) { applySurfaceShatterCallback( $parent ); } else if ($shatterType == "shatterSolidTab" ) { applySolidShatterCallback( $parent ); } else if ($shatterType == "shatterCrackTab" ) { applyCrackShatterCallback( $parent ); } if ($executeCmd) { performDynamicsClipEffects "Shatter" 0; string $tmpCmd = "performDynamicsClipEffects \"Shatter\" 0"; addToRecentCommandQueue $tmpCmd "Shatter"; } } // ================ applySurfaceShatterCallback ================ // // SYNOPSIS // Callback for the "Create" button for the surface shatter clip effect. // // INPUT ARGUMENTS // int $parent the parent layout // // global proc applySurfaceShatterCallback (string $parent ) // // Description: // Set the optionVar from the control values. // { optionVar -stringValue shatterSurfaceName `textFieldGrp -q -text shatterSurfaceName`; optionVar -intValue shatterSurfaceShardCount `intSliderGrp -q -v shatterSurfaceShardCount`; // optionVar -intValue shatterSurfaceExactCount // `checkBoxGrp -q -v1 shatterSurfaceExactCount`; optionVar -intValue shatterSurfaceTriangulate `checkBoxGrp -q -v1 shatterSurfaceTriangulate`; optionVar -intValue shatterSurfaceSmoothing `checkBoxGrp -q -v1 shatterSurfaceSmoothing`; optionVar -floatValue shatterSurfaceExtrude `floatSliderGrp -q -v shatterSurfaceExtrude`; // optionVar -floatValue shatterSurfaceEdgePerturbation // `floatSliderGrp -q -v shatterSurfaceEdgePerturbation`; optionVar -intValue shatterSurfacePostOp `optionMenuGrp -q -sl shatterSurfacePostOperation`; optionVar -intValue shatterSurfaceVerbose `checkBoxGrp -q -v1 shatterSurfaceVerbose`; int $originalSurface = `radioButtonGrp -q -select shatterSurfaceOriginal`; if ( $originalSurface == 0 ) { $originalSurface = `radioButtonGrp -q -select shatterSurfaceOriginal1` + 3; } optionVar -intValue shatterSurfaceOriginal $originalSurface; optionVar -intValue shatterSurfaceMakeRigidBody `checkBoxGrp -q -v1 shatterSurfaceMakeRigidBody`; optionVar -intValue shatterSurfaceSeedValue `intSliderGrp -q -v shatterSurfaceSeedValue`; } // ================ applySolidShatterCallback ================ // // SYNOPSIS // Callback for the "Create" button for the solid shatter clip effect. // // INPUT ARGUMENTS // int $parent the parent layout // // global proc applySolidShatterCallback (string $parent ) // // Description: // Set the optionVar from the control values. // { optionVar -stringValue shatterSolidName `textFieldGrp -q -text shatterSolidName`; optionVar -intValue shatterSolidShardCount `intSliderGrp -q -v shatterSolidShardCount`; optionVar -intValue shatterSolidTriangulate `checkBoxGrp -q -v1 shatterSolidTriangulate`; optionVar -intValue shatterSolidInteriorMaterial `checkBoxGrp -q -v1 shatterSolidInteriorMaterial`; optionVar -intValue shatterSolidRemoveInterior `checkBoxGrp -q -v1 shatterSolidRemoveInterior`; optionVar -floatValue shatterSolidExtrude `floatSliderGrp -q -v shatterSolidExtrude`; optionVar -floatValue shatterSolidEdgePerturbation `floatSliderGrp -q -v shatterSolidEdgePerturbation`; optionVar -intValue shatterSolidPostOp `optionMenuGrp -q -sl shatterSolidPostOperation`; optionVar -intValue shatterSolidVerbose `checkBoxGrp -q -v1 shatterSolidVerbose`; int $originalSurface = `radioButtonGrp -q -select shatterSolidOriginal`; if ( $originalSurface == 0 ) { $originalSurface = `radioButtonGrp -q -select shatterSolidOriginal1` + 3; } optionVar -intValue shatterSolidOriginal $originalSurface; optionVar -intValue shatterSolidMakeRigidBody `checkBoxGrp -q -v1 shatterSolidMakeRigidBody`; optionVar -intValue shatterSolidSeedValue `intSliderGrp -q -v shatterSolidSeedValue`; } // ================ applyCrackShatterCallback ================ // // SYNOPSIS // Callback for the "Create" button for the surface shatter clip effect. // // INPUT ARGUMENTS // int $parent the parent layout // // global proc applyCrackShatterCallback (string $parent ) // // Description: // Set the optionVar from the control values. // { optionVar -stringValue shatterCrackName `textFieldGrp -q -text shatterCrackName`; optionVar -intValue shatterCrackCount `intSliderGrp -q -v shatterCrackCount`; optionVar -intValue shatterCrackLength `intSliderGrp -q -v shatterCrackLength`; optionVar -intValue shatterCrackTriangulate `checkBoxGrp -q -v1 shatterCrackTriangulate`; optionVar -floatValue shatterCrackExtrude `floatSliderGrp -q -v shatterCrackExtrude`; optionVar -floatValue shatterCrackEdgePerturbation `floatSliderGrp -q -v shatterCrackEdgePerturbation`; optionVar -intValue shatterCrackPostOp `optionMenuGrp -q -sl shatterCrackPostOperation`; optionVar -intValue shatterCrackVerbose `checkBoxGrp -q -v1 shatterCrackVerbose`; int $originalSurface = `radioButtonGrp -q -select shatterCrackOriginal`; if ( $originalSurface == 0 ) { $originalSurface = `radioButtonGrp -q -select shatterCrackOriginal1` + 3; } optionVar -intValue shatterCrackOriginal $originalSurface; optionVar -intValue shatterCrackMakeRigidBody `checkBoxGrp -q -v1 shatterCrackMakeRigidBody`; optionVar -intValue shatterCrackSeedValue `intSliderGrp -q -v shatterCrackSeedValue`; }