Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

A New Hope (for the import of Maya multiple sculpty scenes)

Leben Schnabel
Registered User
Join date: 4 Jan 2007
Posts: 62
08-16-2008 04:43
The Maya users here will know that the import and automatic in-world assembly of a Maya Scene consisting of multiple sculpties with the help of Qarls scripts has been borked in one of the last updates. A coder friend of mine, who wishes to remain unnamed, has modified both the Maya MEL script and the LSL scripts that process the data. The resulting process a) works and b) is much more convenient as before.


Since these forums currently seem to be unable to handle any attachments, please go here to continue and to get these scripts:

http://www.sluniverse.com/php/vb/content-creation/15765-new-hope-import-maya-multiple.html#post347709


I might not be able to answer questions to these scripts and their usage in a timely fashion since I’ll be on a business trip. Also, I’m completely clueless about scripting and will have to check back with my friendly coder. I’ll try to help, but don’t count on an immediate response, please. And lastly, my coder has agreed to adjust these scripts to whatever Linden Labs breaks next in one of their updates. In this case, watch this space...

Happy sculpting,
-L
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
08-16-2008 08:46
Leban, thanks very much to you and your friend, whoever he/she is, for doing this.

You should be able to attach the files right here, though. Attachments were only disabled globally for short time a couple of years ago. They were restored for the content creation forums a few weeks later.

If you're truly unable to post attachments here for some strange reason, would you mind just pasting the text of the scripts? Or else put them somewhere on the Web, and link them here? Unfortunately the link in your original post requires registration in order to view the files. I'd rather not register over there if I don't have to. Thanks so much. :)
_____________________
.

Land now available for rent in Indigo. Low rates. Quiet, low-lag mainland sim with good neighbors. IM me in-world if you're interested.
Leben Schnabel
Registered User
Join date: 4 Jan 2007
Posts: 62
08-16-2008 22:53
Chosen, no matter what file format I try, I get this error message here:
From: someone
There seems to have been a slight problem with the SL Forums database.
Please try again by pressing the refresh button in your browser.

An E-Mail has been dispatched to our Technical Staff, who you can also contact if the problem persists.

We apologise for any inconvenience.

I'll upload the ZIPped files to a bit of webspace I happen to have access to. The next post will have the link and the explanatory text.

-Leben
Leben Schnabel
Registered User
Join date: 4 Jan 2007
Posts: 62
08-16-2008 23:03
OK, next try for those who don't want to register on the other forum. Get the scripts here:

http://www.landgasthof-waldschaenke.de/sculptytutorial/Maya-SL_scene_import.zip


I'm posting the scripts here to give back to the community. USE THEM AT YOUR OWN RISK. THESE SCRIPTS WILL NOT BE SUPPORTED. (C) 2008 LEBEN SCHNABEL. NOT FOR COMMERCIAL PURPOSES WITHOUT WRITTEN CONSENT.

If you’re not familiar with the export/import process from Maya into SL, read here first:
http://wiki.secondlife.com/wiki/Advanced_Sculptie_Exporter_From_Maya
You can skip the paragraph “In-world Scripts” on this page, we’ll substitute them. Please don’t post general questions about the import into this thread, open a new thread instead.


How to use the scripts
================
Instead of the old MEL script, use the new MEL script in MEL.txt. Copy and paste into Maya and run it just as you did with the original script.

In-world, you’ll need the two LSL scripts in the .ZIP file, ReadImport.txt and ReceiveData.txt. Copy the text in them and create two scripts in SL. Name them according to their filenames, “ReceiveData” (this name is mandatory) and “ReadImport” (can also have another name).

Create two prims of any shape. Name one of them “Receive Data” (this name is mandatory, note the space) and one of them “Rez Maya Scene” (can also have another name).

Put the following into the prim “Rez Maya Scene”:
- The “Receive Data” PRIM
- The “ReadImport” SCRIPT
- A notecard of any name that contains the “*.primscript” data that the Maya MEL script generated
- And all the sculpt and surface textures that belong to your exported Maya scene

Then, just touch the object and it’ll assemble your sculpties.


Extra feature
==========
The scripts will scan for certain substrings in your texture names and set the sculpty type accordingly. If a sculpt texture name contains “planesculpt”, it’ll be set to sculpty type PLANE automatically (this has been tested). Also, the substring “cylindersculpt” should work and set the sculpty to CYLINDER (not tested!). Default is sculpty type SPHERE.


Explanation of files in "Maya-SL_scene_import.zip"
===================================
MEL.txt : The MEL export script for Maya
ReceiveData.txt : The LSL script to be named “ReceiveData” and to be put into a prim named “Receive Data”
ReadImport.txt : The LSL script to be put into the prim that’ll rez the Maya scene
Import_Prim.jpg : This is how the contents of the prim that’ll rez the Maya scene should look like.


Finishing remarks
=============
Again, I might not be able to answer questions to these scripts and their usage in a timely fashion since I’ll be on a business trip. Also, I’m completely clueless about scripting and will have to check back with my friendly coder. I’ll try to help, but don’t count on an immediate response, please. And lastly, my coder has agreed to adjust these scripts to whatever Linden Labs breaks next in one of their updates. In this case, watch this space...


Happy sculpting,
-L
Dnali Anabuki
Still Crazy
Join date: 17 Oct 2006
Posts: 1,633
08-17-2008 07:19
Thanks! What a neat thing to do. Makes me want to try sculpties and Maya again.
_____________________
The price of apathy is to be ruled by evil men--Plato
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
08-17-2008 08:40
Thanks again, Leban. I've downloaded the files. I'll play with the system as soon as I have a little time, and I'll let you know what I think. I'm especially intrigued by the automatic sculpt-type detection. If that works, it will be a fantastic improvement.
_____________________
.

Land now available for rent in Indigo. Low rates. Quiet, low-lag mainland sim with good neighbors. IM me in-world if you're interested.
Brookston Holiday
Registered User
Join date: 29 May 2005
Posts: 58
09-15-2008 15:18
I can't get these to work to save my life.... still has everything flying off in its own direction nothing lines up. This is very frustrating.
Leben Schnabel
Registered User
Join date: 4 Jan 2007
Posts: 62
09-17-2008 11:25
Here are two general caveats that might solve your problem (both stem from the original scripts on which mine are based on):

- If you export into the same folder multiple times, make sure to delete the .primscript file before every export. For some strange reason, the export script attaches new coordinates instead of replacing the file.

- Make sure that EVERY sculpty in the scene is below 10 units in Maya.

Adhering to these rules, I used the scripts that I posted about 2 or 3 dozen times without any problems.

Good luck,
-L
Brookston Holiday
Registered User
Join date: 29 May 2005
Posts: 58
09-21-2008 21:03
I had no idea about the 10 maya units, although now that I think about it, that makes perfect sense. /me slaps head


Thanks!
Brookston Holiday
Registered User
Join date: 29 May 2005
Posts: 58
09-21-2008 21:09
Okay, now that I have them under 10 (mayans?) units, it is getting closer. I read somewhere else you have to freeze transformations and delete history on all the nurbs before you export. Is this true? Because many of the pieces seem to be in the correct place now but sometimes rotated incorrectly or the x and y or x and z scales will be swapped. Weird little things like that keep cropping up... any suggestions?

Any Idea why the textures that it makes get assigned to 180 degrees and I have to manually rotate them to -90 degrees to show up correctly on the sculptie?
Leben Schnabel
Registered User
Join date: 4 Jan 2007
Posts: 62
09-22-2008 03:16
From: Brookston Holiday
Okay, now that I have them under 10 (mayans?) units, it is getting closer. I read somewhere else you have to freeze transformations and delete history on all the nurbs before you export. Is this true? Because many of the pieces seem to be in the correct place now but sometimes rotated incorrectly or the x and y or x and z scales will be swapped. Weird little things like that keep cropping up... any suggestions?

Any Idea why the textures that it makes get assigned to 180 degrees and I have to manually rotate them to -90 degrees to show up correctly on the sculptie?


I highly recommend searching this forum for all posts by "Chosen Few" and with "Maya" in the post's subject or text body. Chosen is an unbelievably valuable source of information about working with Maya. There, you'll also find the information that you indeed need to do the following steps before export:

- Ungroup all objects
- Delete History
- Freeze Transformation (2x if a pink warning message appears in the lower right status line)
- Reset Transformation
- Delete History again

As for the rotating: The objects themselves should not be rotated after the steps mentioned above except maybe the whole group of them. Correcting this is easy of course.
The textures on the objects need to be set to a rotation of -90° after the import. No idea why that is the case, but it's so easily corrected that I personally don't mind.
Brookston Holiday
Registered User
Join date: 29 May 2005
Posts: 58
09-23-2008 00:30
Thanks for your responses.... I looked around the forums and am learning a lot!
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
09-23-2008 00:40
From: Brookston Holiday
Any Idea why the textures that it makes get assigned to 180 degrees and I have to manually rotate them to -90 degrees to show up correctly on the sculptie?

The reason for the -90 is that the default topology for sculpties is spherical. Spheres in SL require a texture rotation of -90 degrees in order for textures to align with the poles. I'm not sure why it's set up that way, but it is what it is.

As for why the textures are defaulting to 180, I don't know. I would assume it's something to do with the way the uploader/assembler program assigns properties after it generates each prim. As Leban said, though, it's not a big deal to correct by hand. Simply select the whole linkset, and switch all the texture alignments to -90 at the same time.


From: Leben Schnabel
I highly recommend searching this forum for all posts by "Chosen Few" and with "Maya" in the post's subject or text body. Chosen is an unbelievably valuable source of information about working with Maya.

Thanks for the kind words, Leban. I still haven't had time to experiment with your assembler, but as promised, I'll post a full critique here as soon as I do. It's looking like I'll have a lull between projects next week, so hopefully I'll get to play then.
Harlow Vaniva
Alt Account! Born n 2006!
Join date: 16 Oct 2009
Posts: 24
10-23-2009 13:58
Just a heads up... This works perfect for me! Came out perfect on the first try.
Fortunately so, too, because I can't get any of the other ones to work.
Thank you!
And yes I know this thread is old, but this is the first one that has worked for me so I thought I'd let people know who may not be able to get the other ones to work.
_____________________
-*-*-*-
I'm an alt account, so I'm not as new or stupid as I look. My other account was born in 2006 ;p