Anim8or Community

Please login or register.

Login with username, password and session length
Advanced search  

News:

Ian Ross has just released a book on Anim8or. It's perect for a beginner and a good reference for experienced users. It contains detailed chapters on every aspect, with many examples. Get your own copy here: "Anim8or Tutorial Book"

Author Topic: Learning ASL: want to contribute? thing's might be helpfull to know about  (Read 22079 times)

polyGon_tError

  • Jr. Member
  • **
  • Posts: 50
    • View Profile

if you want to learn ASL, have coding experience with any language this forum may help you
to be with ASL.

ASL is based on C and is a interpreted Scripting language for Anim8or.
if you can programe in C language or understand coding in it, it will be helpfull.
if you know Action Script (flash), lingo (directory), python (blender, maya, & other)
C++ ,pascal ,visual basic ,java or even Java Script it will be helpfull too.

but there are few thing that may work different way :
1. ASL have no support for function, module, procedure, recursion, iteration, sub-routine.
2. ASL have no support for user input, event trace, interface access (have but limited).
3. ASL work top-down order way, no support for 'goto' like looping control.
4. ASL have 'for', 'if', 'while' support but check their usage in the manual.
5. ASL can't take all Array data in a single statement, from Linear-List/Data-Set like C.
6. you must use '$' sign (like PHP) with all variable and other if needed.
7. ASL support complex, compound argument, parameter to default function.
8. ASL have no support for 2d, 3d Array, DataList and 'evalute' like function.
9. you can't use compound value assignment like k+=1 or k++, use k=k+1 for it.
a. ASL have no support for User-Defined-Data-Type, using many array is only solution.
b. ASL is for 3D mostly so a little knowledge of 3D (mostly OpenGL) will be helpfull.
c. you will be required to know about vector, matrix, trigonometry & physics as well
    to be able to make complex Script that can do amusing things!
d. ASL only support file Read / Write operation for Inport / Export Script.
e. timing based Scripting is supported in 'Scene' only with Object parameter.
f.  ASL is limited to memory, very big array or long process can crash Anim8or.
g. there is a option (using while loop) to create inter-active / auto tool's.
h. debuging is possible only using Print statement with Consol,
    you can also output data / info to a file to analyse it manualy.
i.  you can't make edge directly, can move point, polyGon require to be replaced
    for modification, ASL can't feed selection data to a array like other do.
j.  dealing with normal, texture co-ordinate can be tough some time.
k. if you use polyGon be aware of the vertex order, & winding way (usualy CCW).
l.  some time using pre-defined data and logical pattern will be a good solution.
m. Set / Query operation for array are not present, can push / pop element to / from it of same kind.
n. use '.size' to know or set the size of array, set size to 0 to free up memory and element.
o. deliting anything like vertex, normal, edge, face re-index the rest of the them.
p. there is no way to keep any data in the memory for future reference (esp. in scene view).
q. using Consol to feedback processing information to user can slow it down.
r. ASL support linear (mostly), compound (usualy), complex (possible) way of logical processing.
s. ASL work in single script file, complex number is not supported.
t. ASL script have no undo support. esp. modeling / command script.

before doing any thing check if it is done by another user, check the forum and
other site for ASL or Anim8or Script (.a8s), if it is check if you can do it better
or different way - to not to make anybody upset / unhappy.

you may use 'ASL Editor' (by Kubajzz) or 'NotePad2' (i use it with c++ scheme)
to get help with bracket matching and easy / confuseless coding.

best practice is to make clear what, where, how you want it to work, what will be
needed, what you know for it, make a simple test check the output & your need.
ask for help if needed (at least creating a temporary post for it, you will know).

only available source is :
    "http://www.anim8or.com/scripts/spec/Anim8or_Scripting_Language.html"
there were other source too, but now most are unavailable on the net.
best option is to search for '3D', 'OpenGL' and '3D math' related website / pdf.
basicaly all script are open source (if somebody ask for a credit give it!).
take what you want, do how you like it, show us - we will love to see it.

« Last Edit: January 07, 2014, 02:32:11 am by polyGon_tError »
Logged

polyGon_tError

  • Jr. Member
  • **
  • Posts: 50
    • View Profile

* usual Scripting process is listed here check to make sure you do it correct way.
ASL usage in Anim8or are as follow :

Parametric-Object Script :
 -> define all the variable / array (can be done on the other part too)
 -> define parameter for the object
 -> use logic and math with the data in process to build the object
 -> build the object polyMesh from it
 -> return it to Anim8or

Modeling Tool / Function Script :
 -> define all the variable / array (can be done on the other part too)
 -> take selected / working mesh, shape & other (can be multiple) in some array
 -> get all mesh, mesh part (vertex, edge, face, normal, texture co-ordinate, material)
      data and isolate selection area data if needed
 -> use attribute to get user optional data
 -> use logic and math to analyse & process the data
 -> apply it to the working mesh (change or re-define as needed)

Import Script :
 -> define all the variable / array (can be done on the other part too)
 -> open a file needed to import from
 -> parse it as string using string function and logical process
 -> define the object, use processed data to build the object

Export Script :
 -> define all the variable / array (can be done on the other part too)
 -> take selected / working mesh, shape & other (can be multiple) in some array
 -> get all mesh, mesh part (vertex, edge, face, normal, texture co-ordinate, material)
      (selection or all object) required to export to a file format
 -> use logic and math to analyse & process the data for the file format
 -> open a file with extension as needed
 -> export the data to the file

Controller Script :
 -> select Object parameter to assign controller script
 -> define all the variable / array for it
 -> location, orientation, scale, visibility, other few parameter can be changed
 -> bind them logicaly & using math with time to animate them
 -> play the scene to test, render to get output

good to remember :
* delit all array data at the end of their usage, esp. reseting size to 0.
* delit all orphen data at the end of the script, esp. polymesh data like normal, texture coordinate.
* comment big, complex script worthfully for future reference.
* give variable meaningfull, related-to-subject like name.
* give sort discription of script function, usage.
* keep little information about ownself within script, avoid giving email address.
* put all required data ( selection, working ) in array to speed up processing,
   instead of findind them every time needed.
* new created object, vertex, edge, face like data are indexed at the end so check reverse way,
  check after recent to find, use them quickly if needed.
* any thing like object, vertex, edge, face if deleted the rest is reindexed so to find privious one
  build an array with them, while deliting using original index value reindex them negeting number
  of time deleted, if possible put them in a array select / mark them then delit them at the end.
* if creating inter-active / auto tool's leave an option to end it manualy.
* avoid creating more then 2 face sharing edge build polygon.
* if normal, texture co-ordinate, material data not working correct way leave them as is.
* avoid creating very big or very small face, subdivide or merge with coding if possible.
* optimize and test script for big, reguler, irreguler, patterned, ordered, seperated polymesh form.
* make sure polygon have correct vertex order ( and winding way ) or it will be invalid ( and fliped ).
* use logic to avoid unwanted modification by command script, undo is not possible.

« Last Edit: January 07, 2014, 02:29:56 am by polyGon_tError »
Logged

polyGon_tError

  • Jr. Member
  • **
  • Posts: 50
    • View Profile

no reply!!!
Logged

Steve

  • Administrator
  • Hero Member
  • *****
  • Posts: 2124
    • View Profile

Maybe no reply, but I think this is a useful list :-)
Logged

lppena

  • Sr. Member
  • ****
  • Posts: 299
  • Anim8or, does a body good.
    • View Profile
    • Truespace Anim8or Casual Modeling Forum.

no reply!!!

What we could use are some simple how to tutorials on how to apply all this useful information Poly. Leroy.
Logged

polyGon_tError

  • Jr. Member
  • **
  • Posts: 50
    • View Profile

Note: ASL Spec get updated please check this page https://www.anim8or.com/scripts/spec/index.html and corresponding build version update page also https://www.anim8or.com/smf/index.php/board,7.0.html , i will try updating this post if i get enough time, Thanks.
Logged