Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Aug 9th, 2005, 1:27 PM   #1
Klarre
Game engine designer
 
Klarre's Avatar
 
Join Date: May 2005
Location: Sweden
Posts: 301
Rep Power: 4 Klarre is on a distinguished road
[MEL (Maya)] Newbie scripter

I have just begun scripting in Maya, and therefor need some help.

The goal is to create a script that generates a textfile that looks like this:
group house
{
    object window
    object door
    object funnel

    position = 23 23 23
    rotation = 45 16 23
    scale = 1 1 1
}
What my Maya script is doing is that it simply goes through the stuff in the scene using ls -as. All my groups in the scene are named like house_grp, where the three last letters should tell the script that it is reading a group.
My problem is:

How do I, from a string, reads the last three characters?

The script look like this so far:
for($each in `ls -as`)
{
    string $str_each = $each;
    // Code here!
    print $str_each;
}

Where it says "Code here!" I want to read the three last characters of the $str_each variable. But how?

/Klarre
Klarre is online now   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting 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
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 1:11 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC