Go Back   AC3D Forums > General > AC3D Suggestions
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 22nd November 2006, 06:49 PM   #1
Xjazz
Junior Member
Junior member
 
Join Date: Aug 2006
Posts: 5
Post Script: a hierarchy tree structure & properties managing script (1.0 beta)

Hi

Word about myself. I'm a Blender user and I write some time ago a AC3D export script, which provide very easy hierarchy tree & properties managing capabilitys.

I made some changes to the script to make it work with .ac files too.

----

Hi

I write an experimental python script for the AC3D users. The target is easier hierarchy tree and properties managing.
http://warezhouze.1g.fi/Here/AC3D/HTP4ac1b0.zip

zip file contains these four files
http://warezhouze.1g.fi/Here/AC3D/files.jpg

Requirement
You must have a python installed to your computer to run this script:
http://www.python.org/download/releases/2.4.4/

Function
The script combine the text file data with source .ac file geometry and texture data to the 'combined.ac' file .

Usage
The source .ac, .txt files and 'combined.ac' template file with HTP4ac1b0.py file must place to same folder.

The .txt text file format is same with my Blender export script. Check the “The ‘htp.txt’ format” part::

****
The 'htp.txt' format

NO KIDS FOR THE OBJECTS: will cause a corrupted AC3D file
NO EMPTY LINES: Will cause ‘ValueError: object ":" not found’ error
NO GROUPS WITHOUT KIDS: will cause ‘ValueError: object "xxxx" not found’ error
NO MISTYPED OBJECT NAMES OR CASES: will cause ‘ValueError: object "xxx" not found’ error

Example

------ The beginning of the htp.txt text object/file-------------------------------------
[#] optional header text
WORLD[,]
[tab]MODEL[,][space]property1{enter)
[tab][tab]OBJECTS[,][space]property1(enter)
[tab][tab][tab]STR01[,][space]property1(enter)
[tab][tab][tab][tab]CIT01[,][space]property1(enter
)
[#] optional footer text
--------- The end of the htp.txt text object/file-----------------------------------------

The script will skip all #-marks and also the texts, which right side of it.
This gives an option to use header, footer texts and also the notes.

There must be always the 'world,' in top-left of the hierarchy tree. The 'world,' don’t have any properties.
Use only tabulators for the hierarchy tree creation. Any spaces will cause corrupted .ac file and / or a script error.
After tabulator comes immediately the group/object name.
The object names are case sensitive. NOTE! The Blender object and mesh names must complete match.
After the group/object name comes the immediate comma and one space.
The lines must end with immediate enter.

OR

In case of the note, there must be a one space before #-mark and the note.
****

The ready text file must have same name with .ac file.

Once files are ready, double click the HTP4ac1b0.py file and dialog opens
http://warezhouze.1g.fi/Here/AC3D/dialog.jpg

Type in the .ac file name with 's, like picture below
http://warezhouze.1g.fi/Here/AC3D/typein.jpg

Remember, the script will over write the combined.ac file everytime so, save the result.
----
Xjazz is offline   Reply With Quote
Old 23rd November 2006, 03:37 PM   #2
Xjazz
Junior Member
Junior member
 
Join Date: Aug 2006
Posts: 5
Default Re: Script: a hierarchy tree structure & properties managing script (1.0 beta)

New version
http://warezhouze.1g.fi//public_html.../HTP4ac1v0.zip

I forget to mention, the script has predefined materals. This is possible to change.

Fixes in final 1.0 version:
- The .ac file name input doesn't need a ' marks any more.
- Added optional output .ac file naming dialog.
- The top 'world' group doesn't need anymore space after the comma.
- The 'loc' data is parsed, if it exists with .ac file object.
- Added the end note with output file name.
- Added error managing routines for the empty .ac name input, missing .txt file and missing object cases.
- Added some code comments

File naming
The .ac and .txt files must have a same name. The script will ask a name for the output file. If not given, the script will automatically give a 'C_(.ac file name).ac'


Group and Object naming
All group and object names must be individual. The object names are case sensitive between .ac and .txt files.

The script will combine only those objects, which are mentioned in .txt file. You can have an assist scene / landscape objects included to the .ac file.


Script testing
I don't have AC3D license so, I don't have that much interest to do a testing with complex .ac objects. The AC3D users can do that job, if interested about the script
Xjazz is offline   Reply With Quote
Old 24th November 2006, 05:45 PM   #3
Xjazz
Junior Member
Junior member
 
Join Date: Aug 2006
Posts: 5
Default Re: Script: a hierarchy tree structure & properties managing script (1.0 beta)

Hi

Version 1.1
http://warezhouze.1g.fi/Here/AC3D/HTP4ac1v1.zip

This latest version is tested much further with more complex object than two previous versions.

Fixed in 1.1:
- top group world writen correctly.
- hierarchy tree without properties won't cause problems anymore.
- texture file name is now parsed if it exists with given object in .ac file.
- dialog window shows how the script sees your .txt file content: Name, properties & kids.
- #-mark started comment lines in middle of the hierarchy tree are supported.

The HTP4acv1v1.zip file contains the new script plus fub2t.ac & fub2t.txt example files and two textures.

The fub2t.ac fuel truck object is based to the fub2.ac object, which is created by HitechCreations (tm) online game company. The original hierarchy tree, properties and loc data is remove from the fub2t.ac file just for example purpose.

ANY comments?
Xjazz is offline   Reply With Quote
Reply

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



All times are GMT -4. The time now is 06:46 PM.


AC3D Forum
(C) Inivis Limited 2020