Saving file copies

Next
 From:  jacobo3d
4917.1 
Hi,

I was trying to see if I was able to create a shortcut to automatically save an IGES file and a LWO of the current 3dm scene, using its name and location. Like, every time I save, the 3dm scene is saved, an IGES file and a LWO file (meshing options panel would open right before saving the LWO). I was digging through the script docs, but still kind of confusing to me (besides the fact that I don't know much about Javascript, pretty much just Python). So then I've tried to go through this page scripts:
http://kyticka.webzdarma.cz/3d/moi/
... to check the code and understand how they work, but it seems to be offline (it doesn't even show up in Google's cache). So that leaves me with the only choice of asking in the forum :).

So, is it possible to do that?

And also, where's the best place to start getting familiar on how Moi scripting works and all that?

Thanks!
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
4917.2 In reply to 4917.1 
Hi Jacobo, Petr's web page seems to be back online now, at least I can reach it from over here anyway.

I have not been able to focus very much time on documentation or support specifically for scripting, since I'm still in the middle of working on a lot of the more "regular end user" type functions in MoI still. At some point in the future when I feel that more of the regular core functionality is covered better then I'll probably be able to spend more time on it.

In the meantime, the best way is to study existing scripts and just try out making some yourself. David Morrill has put together some docs, and you will also want to look at the moi.idl file which lists the MoI object model and you can find what methods and properties are available for scripts to call from that. Check out this wiki page for links to that stuff: http://moi3d.com/wiki/Scripting

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
4917.3 In reply to 4917.1 
Hi Jacobo, and as far as your actual script goes, a version that does it is attached here.

To use it, put it in some folder say for example c:\scripts and then set up a shortcut key and put in the full path to the .js file as the command name, so if the script is in c:\scripts for this one put the command name as:   c:\scripts\DoMultiSave.js

Then when you trigger the shortcut key it will execute that script and you can look into the script to see how it gets the current file name and replaces the file extensions and then saves out the other file types.

When you do a "Save As" of a non-3DM file type it generates the file but it does not become the current file name of MoI, since those other file types do not necessarily store all of the information that MoI can generate, only 3DM files actually save your whole project data including various stuff like your viewport setup, background images, etc...

- Michael
Attachments:

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  jacobo3d
4917.4 In reply to 4917.3 
Hey Michael,

First of all, thank you so much for taking the time to do the script. That's awesome! (and exactly what I needed)

It seems that Petr's web wasn't offline after all. For some reason I can't access from my home computer, but I was able to check it out from work. After going through all the scripts and try a couple of things by myself, it seems pretty straight forward to do simple things to help me out with the workflow (fortunately it looks like javascript is very similar to L-Script -or the other way around, I should say-, which I was familiar with a long time ago... it seems like I still remember a couple of things).

About the scripting docs, I totally understand the development priorities, and they make total sense. It's just that right now I'm trying to see if Moi would fit in our pipeline and how much time it would save, and that's why very specific workflow needs come up (which most of the time are just very simple things like this one, but time savers when you have to do it too often).
I don't want to get to much into the scripting area yet, just to know that it's there and it at least gives me the flexibility to speed up things a little bit if I need to.

Right now I'm more concerned about evaluating where Moi would come useful, and what would be the best way to translate what is created in there to something that is in a way we can work with. But that will take me a bit more time before I start shooting questions in the forum ;)

Again, thanks a lot!
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All