Script Error Origin #MEL
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi, I'm working on a free Nut_Bolt script but I'm getting an error. Let's say I'm Importing the Bolt_01 it's snapping to the selected face but again when I run this script on a new selected face it's taking back Bolt_01 to the origin. It shouldn't happen like that. For more refer video.
- {
- // create a window
- window -title "jay" -menuBar true -w 220 -h 200 "";
- // define the layout of controls added
- // to the window.
- columnLayout;
- // create a collapsible frame layout
- frameLayout -collapsable true -label "Nuts";
- // add the other controls
- flowLayout -columnSpacing 1 -w 220 -h 30;
- symbolButton -image "commandButton.png" -command "sample_Proc";
- setParent ..;
- // show the window we last created
- showWindow;;
- }
- proc sample_Proc()
- {
- string $sel_faces[] = `ls -sl `;
- file -import "E:/Bolt_01.ma";
- select $sel_faces[0] "Bolt_01";
- float $rsScale = size($sel_faces);
- scale -r $rsScale $rsScale $rsScale "Bolt_01";
- string $rspointOnPolyConstraint[] = `pointOnPolyConstraint -offset 0 0 0 -weight 1 `;
- delete $rspointOnPolyConstraint;
- rename "nut_01" "nutPlaced_01";
- makeIdentity -apply true -t 1 -r 1 -s 1 -n 0 -pn 1;
- }
Link copied