View previous topic :: View next topic |
Author |
Message |
JamesH
Posts: 17
Joined: 10 Jul 2007
|
Posted: Sun Jul 19, 2009 9:27 am Post subject: Modo 401 Plugin - 1.2 |
|
|
This is a python script that allows UVLayout to be used as a plugin for Modo 401.
Attached to this post is a zip file, extract the archive and copy uvlayout.py and uvlayout.lxm files into your scripts folder, for Windows 7 it is
Code: | C:\Users\<Your username>\AppData\Roaming\Luxology\Scripts |
And I think for XP it is
Code: | C:\Documents and Settings\<Your username>\Application Data\Luxology\Scripts |
Then copy the uvlayout.cfg into your Configs folder, it is located in the same folder as the above Scripts folder.
At the start of the script (uvlayout.py) is a file location for where your uvlayout.exe is located, there are some for XP and WIn 7 that have been added and commented out. You will need to uncomment one of these or add your own to suit your own system. The UVLayout intermediary files have been moved to the Temp folder identified using Modo's platformservice.
The way to run the script is either from the command line, type @uvlayout.lxm to start the macro, or by binding a key to run this command.
To bind a key, open Modo and from the System Menu, select Input Editor. I bound the command to Ctrl-U. To implement this example, click on the Ctrl Modifier and scroll down to Ctrl-U and type in @uvlayout.lxm as in the Image below. If the Ctrl-U key is not displayed in the list and the key has previously not been used, it is currently unmapped. To view the unmapped keys, check the Show Unmapped Keys check box. After entering the @uvlayout.lxm, make sure you press return so that the new command is registered before you close the Imput Editor window.
Now with a mesh selected type Ctrl-U and the following Popup is displayed.
If the model has more than one UVMap make sure that only one is selected if you want to edit these UVs in UVLayout, otherwise UVLayout will not open anything. (At the moment, if you select more than one UVMap, it will try and import both into UVLayout with undefined results - so please select only one for editing)
When Importing back into Modo, make sure that you click on Send in UVLayout before clicking on Import From UVLayout. If you have the Add New Vmap option checked, a new UVmap will be added to the list of UVMaps, if it is unchecked, all of the UVmaps will be deleted prior to importing the new one.
Future Developments
- Also I'll be adding the commands part of the plugin to the *.cmd file.
- Performance improvements for exporting.
EDIT: Updated to V1.2
Description: |
|
 Download |
Filename: |
UVLayout1-2.zip |
Filesize: |
4.33 KB |
Downloaded: |
3710 Time(s) |
Last edited by JamesH on Fri Jul 31, 2009 7:46 am; edited 7 times in total |
|
Back to top |
|
 |
headus Site Admin

Posts: 2902
Joined: 24 Mar 2005
Location: Perth, Australia
|
Posted: Sun Jul 19, 2009 7:13 pm Post subject: |
|
|
Thanks for your efforts! Hopefully you get some feedback for Modo users out there.
Phil
|
|
Back to top |
|
 |
Rich-Art

Posts: 120
Joined: 29 Dec 2005
|
Posted: Mon Jul 20, 2009 2:17 am Post subject: |
|
|
To bad there still is no Cinema4D plugin..
Peace,
Rich_Art.
|
|
Back to top |
|
 |
JamesH
Posts: 17
Joined: 10 Jul 2007
|
Posted: Mon Jul 20, 2009 12:11 pm Post subject: |
|
|
Added a new version 0.2 that allows the existing vmaps to be kept and not deleted. It adds new vmaps with an incremented index if the parameter Vmap is used on import. For example
Code: | @uvlayou.py Import Vmap |
|
|
Back to top |
|
 |
JamesH
Posts: 17
Joined: 10 Jul 2007
|
Posted: Fri Jul 24, 2009 5:22 am Post subject: |
|
|
I've added a new version 1.0. This contains a .cfg file that adds a form that can be assigned to a key (See first post - GUI heading)
|
|
Back to top |
|
 |
JamesH
Posts: 17
Joined: 10 Jul 2007
|
Posted: Fri Jul 24, 2009 5:48 am Post subject: |
|
|
Phil, I'm having a problem getting UVL to exit, I'm creating a file called uvlayout.cmd (the main obj file is uvlayout.obj) and writing Exit to it (Exit is written to the file) but UVL is not closing.
Any ideas ?
|
|
Back to top |
|
 |
headus Site Admin

Posts: 2902
Joined: 24 Mar 2005
Location: Perth, Australia
|
Posted: Fri Jul 24, 2009 6:03 pm Post subject: |
|
|
That should be working ... case is ignored, so "exit" and "Exit" both work.
Try adding "-debug" to the uvlayout command line ...
uvlayout -plugin -debug file.obj
It prints out what files its tracking, and when they're found etc. Normally you'd run uvlayout from a command shell though in that mode so that the output goes to the shell window ... not sure where it'll go if you run it from your python script.
Phil
|
|
Back to top |
|
 |
JamesH
Posts: 17
Joined: 10 Jul 2007
|
Posted: Sun Jul 26, 2009 10:48 am Post subject: |
|
|
I've added a new upload that fixes a defect and allows individual UVMaps to be selected prior to exporting. I've also added a macro to open the UVLayout popup prior to importing/exporting.
See first post.
I'll also be working this week on getting the commands working if I can find a way of displaying the debug messages.
Cheers
|
|
Back to top |
|
 |
r_knightly
Posts: 74
Joined: 29 Jun 2007
|
Posted: Mon Jul 27, 2009 2:51 am Post subject: |
|
|
Rich-Art wrote: | To bad there still is no Cinema4D plugin..
Peace,
Rich_Art.  |
step up and sort it out. (Admittedly my latest efforts with max have been thwarted with failure)
|
|
Back to top |
|
 |
JamesH
Posts: 17
Joined: 10 Jul 2007
|
Posted: Fri Jul 31, 2009 7:48 am Post subject: |
|
|
I've added a new version, 1.2
New to this release
- Performance improvements exporting to UVLayout
- Progress bars
- Auto calculated temp file locations, just add the location of uvlayout.exe
|
|
Back to top |
|
 |
Rich-Art

Posts: 120
Joined: 29 Dec 2005
|
Posted: Sat Aug 01, 2009 7:37 am Post subject: |
|
|
r_knightly wrote: | Rich-Art wrote: | To bad there still is no Cinema4D plugin..
Peace,
Rich_Art.  |
step up and sort it out. (Admittedly my latest efforts with max have been thwarted with failure) |
LoL I'm not a programmer. I already loose it after 1+1...
Peace,
Rich_Art.
|
|
Back to top |
|
 |
garyhanna
Posts: 7
Joined: 10 Jan 2006
|
Posted: Thu Aug 27, 2009 9:06 pm Post subject: |
|
|
Hi,
Is there any reason this would not work on OS X since it is Python?
Thanks,
Gary
|
|
Back to top |
|
 |
JamesH
Posts: 17
Joined: 10 Jul 2007
|
Posted: Sat Aug 29, 2009 1:22 pm Post subject: |
|
|
garyhanna wrote: |
Is there any reason this would not work on OS X since it is Python?
|
You may have to play around with the path locations and I also use subprocess.Popen, but I'm assuming that subprocess will also work with OSX. If you do get it working, it would be great if you can post any changes you made to the script and I'll update the first post.
Cheers
James.
|
|
Back to top |
|
 |
garyhanna
Posts: 7
Joined: 10 Jan 2006
|
Posted: Sat Aug 29, 2009 2:41 pm Post subject: |
|
|
Thanks James,
I haven't gotten it to work yet. The first thing I did was change the path in the script. When I run it in Modo, the UVLayout dialog come up fine. But once I choose export, i get the processing bar but then it errors out. I think it doesn't like the path to UVlayout but I am not sure.
If I get it working, I will post it.
Thanks again for the script.
Gary
|
|
Back to top |
|
 |
JamesH
Posts: 17
Joined: 10 Jul 2007
|
Posted: Sat Aug 29, 2009 9:25 pm Post subject: |
|
|
I use the temp path queried from Modo using
Code: | tempPath = lx.eval1("query platformservice path.path ? temp") | then adding uvlayout.obj , .out etc to the end.
What you can do is just add
Code: | lx.out("path : %s"%tempPath) |
somewhere in the script so that the path is displayed in the event log, to check it is correct, if this works, then the next step is to make sure that the .obj file is being written to this location.
|
|
Back to top |
|
 |
|