raster Posted January 28, 2009 Share Posted January 28, 2009 I'm fairly new to scripting and this might have been covered somewhere else on this forum but I haven't been able to locate it yet. What I'm looking to do is like what the EditPoly Connect operation has and that is an interactive preview so when you adjust spinners you can visually see what is going to happen. The script that I've (co-)written uses polyOp commands to get faces, vertices and then performs a polyOp.slice command to split the faces based on where the code determines to cut them. Now I'd like the user to be able to visualise where the cutting takes place before they apply the change. The way I thought this could be done is either by using the previewBegin/previewAccept/previewCancel methods of the EditablePoly object. However when I've tried to implement it using this means of previewing it didn't work and I assumed it cannot be done using the polyOp object methods. The other option was placing an undo block around the code and calling an undo everytime the spinner is changed, only allowing the changes to remain when the user presses the apply button. So I guess what I'm asking is, what do you seasoned veterans do to allow for interactive reviewing? Should I be able to use the previewXX methods to revert any changes made using polyOp methods on an EditablePoly? Any help in this matter would be greatly appreciated. Just so you know I have searched through the maxscript help and also google searched for the answer but no luck in finding anything relevant. Link to comment Share on other sites More sharing options...
anton Posted January 29, 2009 Share Posted January 29, 2009 I haven't done anything like this before but all I can say is stay away from doing multiple undos one after the other. My experience with it is that it almost always leaded to a max crash... Another place that you might want to post this is the Maxscript forum over at cgtalk: http://forums.cgsociety.org/forumdisplay.php?f=98 Link to comment Share on other sites More sharing options...
raster Posted January 29, 2009 Author Share Posted January 29, 2009 Thanks for the reply Anton. I have implemented the desired functionality using an undo operation on a spinner change event and then performing the operation with the new value. It seemed to work reasonably well but as you mentioned I did fear that it might a crash through memory leakage or for some other reason. I was going to try using theHold object which is directly working with the core components that handle the undo functionality if I'm not mistaken. I did try and post on cgtalk but my post didn't seem to come up on the forum, which also happened on scriptspot aswell. The other place I posted was The Area and that post did show in the forums. ---------- raster Link to comment Share on other sites More sharing options...
anton Posted January 29, 2009 Share Posted January 29, 2009 i'm glad that undo works for you. I never had any luck with it. Maybe I was the one doing something wrong It's weird that cgtalk and scriptspot acted like that. I had some issues before with cgtalk and what happened is that i ended up posting multiple posts... But you should get some answers from the Area as most of the people on cgtalk are there too. Link to comment Share on other sites More sharing options...
raster Posted January 30, 2009 Author Share Posted January 30, 2009 The other option I started considering lastnight was to draw the sliceguides using gw.polyLine as these methods just draw to the viewport directly instead of modifying the geometry of the selected object. I guess I just really want to know what way is considered the norm. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now