Introduction to Maya - Rendering in Arnold
This course will look at the fundamentals of rendering in Arnold. We'll go through the different light types available, cameras, shaders, Arnold's render settings and finally how to split an image into render passes (AOV's), before we then reassemble it i
# 1 02-02-2005 , 01:00 AM
InvaZimm's Avatar
Subscriber
Join Date: Apr 2003
Location: Florida
Posts: 61

Mel Shuts Down Maya

Hi guys,

I'm currently working on a script and have come to an unexpected road block. While my main for loop runs, Maya suddenly dissappears and fully shuts down. I have never come across anything of the sort before with scripting in Mel. Has anyone ever come across this? Or does anyone know how to get around this predicament? Thanks.


John 'Zimm' Zimmermann
Setup Artist
https://johnzimmermann.com

“Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world." - A. Einstein
# 2 02-02-2005 , 09:19 AM
Alan's Avatar
Moderator
Join Date: Oct 2002
Location: London, UK
Posts: 2,800
You're crashing maya. It means your script is dodgy. You need to debug your script and find out where the crash is occurring. Try commenting lines out and finding the dodgy one.

user added image
Alan


Technical Director - Framestore

Currently working on: Your Highness

IMDB
# 3 02-02-2005 , 03:55 PM
InvaZimm's Avatar
Subscriber
Join Date: Apr 2003
Location: Florida
Posts: 61
Pure_Morning,

I have tracked it down to the fact that it was calling for a namespace that never existed. Tho for some reason, the object that I am importing is not going to the namespace that I specify, it seems to be the specified name but plus 1. Thus later when the script calls on selecting the object based on the specified namespace, it cannot find it.

This is my first time really using namespaces, so I'm not sure if I am doing it correctly. From looking thru the help docs, it seemed like a logical way to go so that each item has a similar namespace but incremented based on the iteration that it came in. Also so that the script could select the object that was imported in so that it can be placed properly in the scene. Hope that makes some sense user added image .


John 'Zimm' Zimmermann
Setup Artist
https://johnzimmermann.com

“Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world." - A. Einstein
# 4 02-02-2005 , 04:12 PM
Alan's Avatar
Moderator
Join Date: Oct 2002
Location: London, UK
Posts: 2,800
well what exactly are you trying to do? just so I can get a better idea. I've never had to us namespaces in my scripts so I may not be able to help with them but maybe I can suggest something else. What does ocurr to me though is that with maya it's usually better to capture the names as maya provides them to you e.g. string $blah = `spaceLocator`

At least that way you avoid weird maya things where it can't find the object you specify.

:bandit:
Alan


Technical Director - Framestore

Currently working on: Your Highness

IMDB
# 5 02-02-2005 , 04:44 PM
InvaZimm's Avatar
Subscriber
Join Date: Apr 2003
Location: Florida
Posts: 61
Pure_Morning,

I'm currently in the process of revamping a script that I wrote working with a friend. It is a city generator. He's doing the models of the buildings and I'm doing the script for it. For this version I am completely rewriting it. This version is to call for a file, to import the building located in it, and then select that building so that it can be placed in the proper position of the current scene. The amount of buildings is based on the user's input.


John 'Zimm' Zimmermann
Setup Artist
https://johnzimmermann.com

“Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world." - A. Einstein
# 6 02-02-2005 , 04:52 PM
Alan's Avatar
Moderator
Join Date: Oct 2002
Location: London, UK
Posts: 2,800
well ok that doesn't seem too hard. Why don't you just import the buildings (or better yet reference them) without namespaces. Unless you need absolutley unique names them I wouldn't worry about it.

What I would do is when I add a building I would create a name for it (based on location on the map size etc etc) and then create a group with that name. Then parent the building under it once referenced in...

How does that sound? No namespace problems

Alan


Technical Director - Framestore

Currently working on: Your Highness

IMDB
# 7 02-02-2005 , 05:27 PM
InvaZimm's Avatar
Subscriber
Join Date: Apr 2003
Location: Florida
Posts: 61
That sounds like a good possibility. The only thing I'm wondering about, and it's porbably what led me to try using namespaces, is when an object is imported it is not selected. How would you select that specific object?

The main reason I wanted to import the buildings rather than reference them, is so that the user didn't have to drag all the building files with them after s/he has made the file.


John 'Zimm' Zimmermann
Setup Artist
https://johnzimmermann.com

“Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world." - A. Einstein
# 8 02-02-2005 , 05:59 PM
Alan's Avatar
Moderator
Join Date: Oct 2002
Location: London, UK
Posts: 2,800
well name the building group the same as the file and then take off the .ma part of the file when you bring it in and then you will know the name of the group.

What you said about the references probably makes sense aswell, but maybe you should make it an option to reference or import?

Alan


Technical Director - Framestore

Currently working on: Your Highness

IMDB
# 9 02-02-2005 , 07:57 PM
InvaZimm's Avatar
Subscriber
Join Date: Apr 2003
Location: Florida
Posts: 61
Thanks a lot for your help and suggestions, Alan. I've finally gotten the script start placing the buildings down. Now that that part's done I can finish it by placing in the collision detection code.

Yeah, I think you're right about making it an option to either import or reference the buildings. The thought never occurred to me for some odd reason user added image .

I noticed in your signature that you work at Framestore CFC, I've become more and more impressed with the work you guys do there, with each project the company's worked on. I've thought about possibly applying there sometime in the future, but some time after I've tweaked my own abilities. I was wondering if you could give me a critique on my current demo reel, if/when you had the time. I would really appreciate it. The link to it is:
https://johnzimmermann.com/gallery.php?p=demo

Again, I very much appreciate the help you've given me on this script.


John 'Zimm' Zimmermann
Setup Artist
https://johnzimmermann.com

“Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world." - A. Einstein
# 10 03-02-2005 , 09:07 AM
Alan's Avatar
Moderator
Join Date: Oct 2002
Location: London, UK
Posts: 2,800
I'll try and take a look at the reel later on today when I get time.

As for the script. How come you need collision detection? just wondering.

user added image
Alan


Technical Director - Framestore

Currently working on: Your Highness

IMDB
# 11 03-02-2005 , 04:00 PM
InvaZimm's Avatar
Subscriber
Join Date: Apr 2003
Location: Florida
Posts: 61
The buildings are placed at a random vert of a base plane. Because of this some buildings may end up penetrating each other, so need to code it so that they can't penetrate each other. I wasn't refferring to using Dynamics. I think I was going to use the bounding box information of the buildings to do so.


John 'Zimm' Zimmermann
Setup Artist
https://johnzimmermann.com

“Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world." - A. Einstein
# 12 03-02-2005 , 05:10 PM
Alan's Avatar
Moderator
Join Date: Oct 2002
Location: London, UK
Posts: 2,800
you could make it easier than that by having a building "footprint" which will cover a set of verts say a 4x4 square. Then you can tell if a building will fit in at a set position without screwing other buildings up. That way you wont have to do collision detection.

Alan


Technical Director - Framestore

Currently working on: Your Highness

IMDB
# 13 03-02-2005 , 05:51 PM
InvaZimm's Avatar
Subscriber
Join Date: Apr 2003
Location: Florida
Posts: 61
I get what you are saying with the footprint, tho each buidling will have to have it's own since they are different sizes. I guess my only problem is being able to fathom how to do it. I've been staring at this project for days on end, and I think that's probably where I got the mental roadblock about this.


John 'Zimm' Zimmermann
Setup Artist
https://johnzimmermann.com

“Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world." - A. Einstein
# 14 07-02-2005 , 11:52 AM
Sparaig's Avatar
Subscriber
Join Date: Jan 2005
Posts: 5

Mel Shuts down maya

Originally posted by InvaZimm
I get what you are saying with the footprint, tho each buidling will have to have it's own since they are different sizes. I guess my only problem is being able to fathom how to do it. I've been staring at this project for days on end, and I think that's probably where I got the mental roadblock about this.

Actually, that kind of thing IS a form of 2D collision detection. Games programming books show how to do this, I believe, but the most efficient algorithms use bit manipulation operators which MEL apparently doesn't have.

The basic way to do it is to define your map to be a bunch of blocks 1 unit (feet/yard/inches/bricks/blocks/whatever) on a side. Now create a 2D array that is the size of your map in units. Each time you want to place a building, check the array to see if there is already a block/brick in that position --if there is, then you have to move over until you can't find one (or move down or both). Once you place a building, update the position array so that set of blocks is marked "taken". Continue til done. Hope this helps.

# 15 08-02-2005 , 12:46 AM
InvaZimm's Avatar
Subscriber
Join Date: Apr 2003
Location: Florida
Posts: 61
Sparaig,

I like your suggestion. Tho my only concern is how to combine it with the setup I currently have. Since the buildings are placed at a plane's verts, it suggests that at least 4 faces are used. These faces can be found using the polyInfo command.

However, the problem that occurred to me, is that some of the buildings are wider than 4 faces. This being the case I'm having trouble expanding from the vert and face information easily provided. Is there a way to expand the polyInfo command or is there a command that I have over looked that can do this as well? Would be a lot nicer if you could pick walk with verts.


John 'Zimm' Zimmermann
Setup Artist
https://johnzimmermann.com

“Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world." - A. Einstein
Posting Rules Forum Rules
You may not post new threads | You may not post replies | You may not post attachments | You may not edit your posts | BB code is On | Smilies are On | [IMG] code is On | HTML code is Off

Similar Threads