headus 3D tools headus 3D tools / 3D scans
Support Forums
 
 FAQFAQ   SearchSearch    UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
headus 3D scans

The Plugin Interface

 
Post new topic   This topic is locked: you cannot edit posts or make replies.
View previous topic :: View next topic  
Author Message
headus
Site Admin


Posts: 2894
Joined: 24 Mar 2005
Location: Perth, Australia

PostPosted: Tue Aug 22, 2006 1:30 am    Post subject: The Plugin Interface Reply with quote

UVLayout v1.14, and above, can be run as a plugin to any application that knows how to talk to it. Its still the same GUI and hotkeys as the stand-alone UVLayout, but file IO is handled through special interface plugins, saving the user from having to load and save files by hand just to move meshes in and out of UVLayout.

The interface specification is described below, which should allow you to write a UVLayout interface plugin for your own favourite application.

How to run UVLayout in "Plugin" mode:
    uvlayout -plugin <name>.obj
This starts up UVLayout with a slightly modified GUI. The Load and Save buttons are replaced with a Send button, which the user would click on when they want to send a modified mesh back to the calling application.

You can append one or more of the following to the "-plugin" argument, separated by commas, to pre-set the load options; SUBD, Poly, Edit, New, Weld, Clean, Detach. For example, the following will start UVLayout with SUBD and Edit already selected:
    uvlayout -plugin,SUBD,Edit <name>.obj
How to send objects to UVLayout:
    write them to <name>.obj
The <name> field above can be anything, though we recommend you try and make it unique; including the process id of the calling application is one way to do this. UVLayout will watch out for this file, so when you want to send a selected object to UVLayout, simply get your interface plugin to save it to the <name>.obj file listed on the uvlayout command line.

Actually a safer way to do this is to write the selected object to a temporary file, then rename that file to <name>.obj. This means that UVLayout won't open and read the file when its only half written, a possibility if you write directly to the export file.

How to receive objects back from UVlayout:
    read them from <name>.out
When the UVLayout "Send" button is clicked, it saves the modifed mesh into <name>.out. If your interface plugin can automatically watch for this file, then it would import that and could either update the selected object with the new UVs, or complete replace it with the object from the file. If you can't set up a "watch" function, then assigning a button or hotkey to load <name>.out would work too.

How to kill UVLayout from your application:
    write "exit" into <name>.cmd
If you want to kill UVlayout from the calling application, just write "exit" into <name>.cmd.

Other commands:

Write one or more of the following commands into <name>.cmd to get UVLayout to do those actions after the OBJ file has been loaded. This <name>.cmd file should be written by the controlling application after <name>.obj is created.
    subd
      Switch UVLayout into SUBD mode

    poly
      Switch UVLayout into Poly mode

    cut <filename>
      Cut all edges listed in <filename>. It should be a text file of vertex index pairs to indicate which edges are to be cut. Vertex indexes should be in the 1 to N range.

    drop
      Drop all geometry.

    auto obj
    auto dxf
    auto eps
      Drop all geometry, flatten, optimize, pack and save it out to the specified format. You can set the Optimize parameters in the GUI to limit the amount of time it spends flattening, and tick the Outline option in the Pattern panel if you only want outlines in the EPS and DXF files.


Phil
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   This topic is locked: you cannot edit posts or make replies. All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group