// =========================================================================== // 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: Mar 20, 1997 // // Description: // The pointCurveConstraintPresetWithOptions() procedure executes a // point curve operation on a nurbs curve based on the option vars. // // Input Arguments: // None. // // Return Value: // None. // proc string pieceTogetherACmd( int $doHistory, int $keepOriginal, float $wt ) // // Description : // put together a pointCurveConstraint Cmd. { string $cmd ; $cmd = "pointCurveConstraint" ; // query history. // $cmd = $cmd + " -ch " ; if( $doHistory == 1 ) $cmd = $cmd + "true" ; else $cmd = $cmd + "false" ; // query replace Original. // $cmd = $cmd + " -rpo " ; if( $keepOriginal == 1 ) $cmd = $cmd + "false" ; else $cmd = $cmd + "true" ; // query constraint weight. // $cmd = $cmd + " -w " ; $cmd = $cmd + $wt ; return $cmd ; } global proc pointCurveConstraintPreset( int $history, int $keepOriginal, float $wt ) // // Description : // { // put together an intersect cmd. // string $cmd = pieceTogetherACmd( $history, $keepOriginal, $wt ) ; int $nitems = 1 ; $cmd = appendToCmdPlaceHoldersForSelectionItems($cmd,$nitems) ; // Get the list of edit points or points on nurbs curve selected. // global int $gSelectCurveParmPointsBit ; global int $gSelectCurveKnotsBit ; global int $gSelectEditPointsBit ; string $ptList[] = `filterExpand -ex true -sm $gSelectCurveParmPointsBit -sm $gSelectCurveKnotsBit -sm $gSelectEditPointsBit `; int $ptCount = size($ptList) ; if( $ptCount < 1 ) { warning((uiRes("m_pointCurveConstraintPreset.kSelectAnEditPoint"))) ; } else { // execute one or more pointCurveConstraintCmds. // string $results[] ; int $nr = size($results) ; string $ptItem[1] ; int $i ; for( $i = 0 ; $i < $ptCount ; $i++ ) { $ptItem[0] = $ptList[$i] ; string $res[] = executeCmdOnItems( $cmd, $ptItem ); $results = stringArrayCatenate( $results, $res ) ; } // for $i // select the results, the XYZ locators. // int $resultCount = size($results) ; if( $resultCount > 0 ) { string $selectString; // select all results. // $selectString = "select -r "; $resultCount = size($results) ; for( $i = 0 ; $i < $resultCount ; $i++ ) { $selectString += $results[$i] ; $selectString += " " ; } $selectString += " ;" ; eval $selectString ; // set filter type to XYZ locators. // filter out only the locators. // $results = `filterExpand -ex true -sm 24`; $resultCount = size($results) ; $selectString = "select "; for( $i = 0 ; $i < $resultCount ; $i++ ) { $selectString += $results[$i] ; $selectString += " "; } $selectString += ";"; select -cl ; eval($selectString) ; } } }