Anim8or Community

Please login or register.

Login with username, password and session length
Advanced search  


An update to Anim8or, v1.00b, is available with a few bug fixes. Get your copy HERE. See the "ReadMe" file for details.

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - Raxx

Pages: 1 [2] 3 4 ... 6
ASL Scripts / Select Larger/Smaller
« on: October 30, 2014, 03:17:53 am »
In the zip file attached are two scripts, "Select Larger.a8s" and "Select Smaller.a8s". Install them into your scripts directory.

As one might imagine...
  • If you select a shape and activate either script, then it'll select all larger or smaller shapes in that object (by volume of the bounding box).
  • If you select a face and activate either script, then it'll select all faces in the object that are larger or smaller than the currently selected face(s).
  • If you select an edge and activate either script, it'll select all edges that are longer or shorter than the currently selected edge(s).

If you select more than one shape, it adds the volumes together and searches for shapes larger/smaller than their combined individual volumes. The same applies to faces and edges. This way you can select, say, a blob of faces and find all faces that are larger or smaller than that blob.

The "Selection Margin" float attribute allows you to define a percent margin between -1 and 1. A margin of, say, 0.1 when Selecting Larger faces, will select all faces that are 0.9 times the surface area of the currently selected face(s) or larger. A -0.1 would select all faces that are 1.1 times the area or larger. It's flipped for selecting smaller: a 0.1 when Selecting Smaller would select all faces that are 1.1 times or less the area, and -0.1 would select all that are 0.9 times or less the area. The default is 0.00. Whenever you run any of the two scripts, this attribute is automatically created so that you can jump in and adjust the margin with ease.

On a frame where a morph target is being used, the changes done by the morph is not reflected in the .3ds file that is exported on that frame.

ASL Scripts / Advanced Spherize
« on: October 20, 2014, 05:24:24 am »
Alright, this tool lets you make spherical any mesh object. Install the two scripts into your scripts directory, and then create the Spherize Helper Shape (parametric shape button in your left toolbar) around whatever you want to spherize. The helper shape has a lot of options, so double click it and play with it to figure out the behavior.

It's a little funky, use at your own risk. It does work with morph targets though....

  • Convergence Radius: This is the middle line where points (can) converge. This is changed by using the Uniform Scale tool, or by manually entering the parameter. Radius is in Anim8or units.
  • Inner Radius: This is the small dotted circle within the Convergence Radius. It indicates where points begin to converge towards the convergence radius (or where they stop if inverted). This is changed by scaling along the Y axis using the scale tool, or by manually entering the parameter. The number is the multiplier (ie 0.50 would be half the Convergence Radius)
  • Outer Radius: This is the large dotted circle outside of the Convergence Radius. Same as inner radius, in concept. This is changed by scaling along the X axis using the scale tool, or by manually entering the parameter.
  • Inner Falloff: 0 means no falloff, which means all points in the inner circle will be flattened against the Convergence Radius (if inverted, against the Inner Radius). 1 means linear falloff, which is a fade effect in terms of strength as the distance is greater/smaller
  • Outer Falloff: Same as Inner Falloff (in concept)[/b]
  • Invert Outer Dir: Invert the outer direction. Basically flips the direction the points will move. (0 is default, 1 flips)
  • Invert Inner Dir.: Same as above.
  • Strength: Global adjustment of the influence that helper object has on the meshes. 0.000 (no influence) to 1.000 (max influence)
  • Dot Density: Density of the little indicator arrows in the helper shape. Aesthetics. 0.000 to 1.000

You can have more than one helper shape in an object at a time. Multiple helper shapes can influence single/multiple meshes. You can limit the deforming to selected meshes or selected points within those meshes. If nothing is selected, all meshes in the object will be deformed if within radius of the helper shapes.

Note: The changes the Spherize script does cannot be undone. Best to play with copies of the meshes in a new object or be prepared to reload the file.

I was going to include subdivision meshes but forgot that the cage data can't be accessed :P

For various reasons, a user may need to get the shape's position and orientation (and other details) from within that shape's script. Assuming $S was the shape in the "#return($S)" directive, $S.loc, $S.orientation, and $ should return the proper information.

Finished Works and Works in Progress / Doodling
« on: May 29, 2014, 07:03:07 am »
Alright, figured I'd start exercising my creative muscles, they've been sitting in the muck for a little too long. This topic is for my art that doesn't really qualify as a "project" by itself, but rather more for exercise and practice. Or other random stuff.

First up, a dinosaur/monster/toy thing that I've had sitting around the back of the brain for a while. I made a rough sketch, created a vector version, and then modeled and textured it. I wanted to go for that "painted" texture look, and I think I got kind of close. Low poly, no real target triangle count at 934 triangles, just wanted something that was easy to make that still loaded easily in the web browser ;)

Screenshot attached for those who might have trouble viewing it...

General Anim8or Forum / Anim8or Skype Chat
« on: May 28, 2014, 08:23:24 pm »
Summer's here (school-summer), and I'm always logged into Skype. I figure, why not start an Anim8or group there? It's much better for chatting than IRC, so it may become a good alternative for now.

If you want to be a part of it, add me to your contacts (mention that you're from the Anim8or forums) and I'll put you in the group.

My handle: raxx_isbak

General Anim8or Forum / Anim8or 3D Viewer
« on: April 08, 2014, 02:24:49 pm »
Anim8or 3D Viewer

3D and...more?

Good day ladies and gentlemen. I present to you the first release of the Anim8or 3D Viewer. This is an encompassing forum mod that not only lets you embed Anim8or attachments directly in your post, but also images, videos, and ASL.


.an8 Attachments
If you attach a .an8 file and its textures (if applicable), you can embed it directly in the post using this BBC:
Code: [Select]
[attach <width> <height> <options={params}>]<index>[/attach]
This is the attachment number (counting down the list of attachments for that message, starting with index 1). If you're embedding the first attachment in the list, the index would be 1. If you want to embed the 4th attachment, the index would be 4.

<width> and <height>
The width and height use the standard width=# height=# syntax within the attach tag. If one or the other is missing, the default values will be used instead.
  • width: [Integer: Default 640] Width of the plugin
  • height: [Integer: Default 480] Height of the plugin

Optional parameters for when embedding .an8 files. The syntax for the parameters is something like this {parameter: value, parameter: value, ...}. You can include one, some, all ,or none of the following:
  • background: [mixed] Can be the url to an image, a css hex color (#000, for example), or "none". Defaults to a generic background image.
  • wireColor: [Hex Color: Default #666699] The color of the wireframe lines
  • uiColor: [Hex Color: Default #fff] The color of the ui elements (icons and text)
  • uiShadow: [Boolean: Default true] Enable/Disable the shadow effect on ui elements
  • locked: [Boolean: Default true] Lock the interface (no ui elements or interaction)
  • autoRotation: [Boolean: Default false] Disables the autorotate feature
  • shading: [Integer: Default 2] Type of shading. 0 is no shading, 1 is flat shading, 2 is smooth shading
  • softwareRender: [Boolean: Default false] Enables software (HTML5) canvas rendering. Overall not recommended, webGL incompatible devices will automatically fall back to this
  • doubleSided: [Boolean: Default false] If you need backfaces enabled, set this to true. Note: can lead to a performance decrease on large files

IMPORTANT: All hex colors and background (none/url/color) data must be enclosed in quotes. All other values (booleans and integers) must NOT be enclosed in quotes. Note the camelcase (capitalized letters within the parameter name). Eventually I'll make it case-insensitive, but for now please follow it strictly.

Image Attachments
If you wish to embed an image attachment, you can embed it the same way as .an8 attachments, except without the "options" parameter.
The width and height will be scaled accordingly if one or the other is missing. If no width or height is set, the width will be set to the default (and height scaled).

An image attachment would look something like this, in code:
Code: [Select]
[attach width=640 height=480]1[/attach]
Video Attachments
If you want to attach a video file, you can upload flv, mp4, ogg/ogv, and/or webm. If you need a program to convert to those formats, try the Freemake Video Converter (opt out of the addon software during installation--it's an excellent program otherwise), or another converter of your choosing. Attaching and embedding video files is done exactly the same way as with .an8 attachments, except with different options:

  • autoplay: [Boolean: Default false] Enable/Disable autoplay. Plays the video as soon as the web page loads
  • loop: [Boolean: Default true] Loops the video
  • controls: [Boolean: Default true] Show/hide the controls

An example of the video attachment code, with options, would be:
Code: [Select]
[attach width=640 height=480 options={controls:false, loop:true, autoplay:false}]1[/attach]
If you choose mp4/ogg/webm, consider uploading all of them into the same post. Those use HTML5 video embedding, and one format may not be compatible with a browser, but another will. I made it so that it automatically sources all videos of the same name, of those formats, into the same video so that the browser can fallback to whichever one it's compatible with. You'll need modern versions of Internet Explorer, FireFox, or Chrome that support HTML5 video playback.

Flv (flash video) could be your best bet for universal compatibility. Granted, some (mobile) browsers/operating systems don't support flash, but otherwise it's widely supported. If you choose flv, include both the width and the height in the parameters since there is no automatic aspect ratio retention.

.a8s Attachments
Attaching and embedding .a8s files is the same as with the others, except that there are no parameters:
Code: [Select]
What this does is embed the content of the .a8s file into your post with syntax highlighting and line numbering.

ASL Snippets
You can copy and paste ASL directly into your post and it'll be syntax highlighted just like with .a8s attachments. Make sure you put the ASL text in between asl tags, like so:
Code: [Select]
[asl title="optional"]ASL goes here[/asl]
The title is optional, and if excluded then "ASL Snippet" will be used instead.


Code: [Select]

Code: [Select]
[attach width=720 height=360 options={shading:0, wireColor:"#fff", uiColor:"#000000", uiShadow:false, background:"none"}]2[/attach]

Code: [Select]
[attach options={shading:0, locked:true, background:"#666699"}]2[/attach]

Code: [Select]
[attach options={shading:0, autorotation:false, background:""}]2[/attach]

Code: [Select]
[attach width=400]1[/attach]

Code: [Select]
[attach options={controls:false, autoplay:true}]10[/attach]

Hiding Attachments

You might have noticed that when you edit or make a new post, the attachments have a new option next to them labeled "Do Not List". When checked, that attachment will no longer show up on the list of attachments that gets displayed under that message. This post is an example of all of the attachments being hidden.

Notes About The 3D Viewer

The 3D viewer is still in its rough initial stages. Here are some things to keep in mind:
  • You can only view mesh shapes in objects
  • Subdivision meshes show up in their unsubdivided state
  • Internet Explorer is horrible. If you report problems while using it, you will be ignored.
  • Materials aren't 100% accurate. There are differences. For example, if you have a black diffuse rgb color with a texture, the mesh will show up black. In Anim8or, this does not happen.

Something cool: You can view these in mobile browsers that support WebGL. Looks awesome in Opera Browser for Android ;)


I intend on adding more features over time, eventually allowing everything to be viewed in the 3D viewer, from objects to scenes.

If you have bug reports, suggestions, or other feedback, the place to do so is in this post or via pm. If it's a 3D viewer bug report, please provide your browser (and version), the offending .an8 file and related textures, and specific information about what you're experiencing.

Thanks and enjoy the update!

I think this is an old issue, but while working on the browser plugin I came across this problem and would like to see if this'll get fixed.

For cube maps, Up (+Y) is actually used as the Down (-Y), and vice versa.

General Anim8or Forum / Anim8or Projects
« on: March 29, 2014, 08:44:16 pm »
Hello everyone, I figured I'd introduce (what feels like) many projects I have planned that revolve around Anim8or. Steve is actively developing Anim8or, so I am trying to actively contribute to the Anim8or environment.

I'm posting this because these are pretty large in scale and take time, so I want to avoid conflicts of interest and have a place to update my progress. These projects will be publicly released at each milestone in development.

If you have any questions or comments or requests, let me know, thanks.
Progress: Milestone 1
Language: PHP, Javascript, HTML
Libraries/Dependencies: CakePHP, JQuery
Description: Heavy Anim8or resource website. Will contain a repository for models and scripts and related software and tools, tutorials, and custom manual. Completely ad-free, requires user account to add resources, but otherwise guest-friendly downloads. Likely endorsed by Steve upon completion.

Note: Development is currently being done locally. No changes will be visible on the actual domain as of yet.

Current Progress Screenshot

Milestone 1 (Not Started | In Progress | Completed)
  • Basic Visual Design and Layout
    • Logo
    • Navigation
    • CSS Styling
  • Basic Features
    • User Authentication System
    • Home Page - News(Add/Edit/View)
    • Scripts Repository (List/Add/Edit/View)
Milestone 2 (Not Started | In Progress | Completed)
  • Completed Visual Design and Layout
  • Advanced Features
    • Previous Features Enhanced
    • Tutorials System
    • Models Repository
Milestone 3 (Not Started | In Progress | Completed)
  • Completed functionality
    • Software Repository
    • Manual

Anim8or File Converter (title pending)
Progress: Milestone 1
Language: C#
Libraries/Dependencies: Custom Anim8or File Parser Library, OpenTK, .NET 4.0
Description: A toolkit that converts Anim8or files to popular formats or vice versa. Full scene and animation support. DAE and FBX formats supported. 3D viewer/playback and export options.

Current Progress Screenshot

Milestone 1 (Not Started | In Progress | Completed)
  • Anim8or Parser Loading Ability
    • Objects
    • Figures
    • Sequences
    • Scenes
  • .DAE Export Ability
    • Objects
    • Figures
    • Sequences
    • Scenes
Milestone 2 (Not Started | In Progress | Completed)
  • Anim8or Parser Saving Ability
    • Objects
    • Figures
    • Sequences
    • Scenes
  • .DAE Import Ability
    • Objects
    • Figures
    • Sequences
    • Scenes
  • Basic 3D Viewer
Milestone 3 (Not Started | In Progress | Completed)
  • .FBX Import and Export
    • Objects
    • Figures
    • Sequences
    • Scenes
  • Advanced 3D Viewer

In-Browser 3D Plugin
Progress: Milestone 1
Language: HTML, CSS, WebGL, Javascript
Libraries/Dependencies: Three.js
Description: A completely client-side plugin that allows anyone to embed their .an8 file directly into a web page.

Milestone 1 (Not Started | In Progress | Completed)
  • Three.js An8Loader - Basic Import
    • Objects
      • Materials & Textures
      • Meshes
      • Wireframe
  • Basic Object Viewer
    • Orbit Controls
    • Toggle Wireframe & Shading
    • Embeddable Plugin Behavior

Milestone 2 (Not Started | In Progress | Completed)

General Anim8or Forum / New Forum Modifications
« on: March 22, 2014, 10:18:13 pm »
Hello all,

You may notice new Youtube and Vimeo icons when making a new post. You can now embed videos from those two websites into your post.

Also added were social media icons. If you go to your profile, you can fill in your Youtube, dA, and other account info to have the icons linking to your websites. As of yet it does not show up in the message posts under your name, it's on the fix-list. It does show up in your profile page, however.

General Anim8or Forum / Robin Diversity
« on: March 10, 2014, 08:15:38 pm »
I needed a break from stuff, so I figured why not have a light-hearted collection of user-made Robins? 2D, 3D, doesn't matter. If you want to make your own Robin, post it here!

The 2D Robin's design is part of a logo for an Anim8or resource website I'm working on, which I will announce when it's at a good development stage. I'm still experimenting with him a bit, so it's probably not the final version.

The 3D one, you guys may already recognize from before. I thought I shared the file a long time ago, but seems like it's not anywhere in the forums. I was extremely lucky that I could find the original model...there are too many old artworks that I've lost permanently :(

ASL Scripts / AOBake
« on: February 25, 2014, 07:35:10 am »
AOBake v0.2
Ok, so I lied. My next script ended up being impractical again. Welcome to AOBake, a raytraced Ambient Occlusion texture baking script for Anim8or.

To use this, select mesh shapes or faces in a mesh shape that you want to bake the AO for. Alternatively you can select nothing and it'll bake AO for all shapes in the object. This script writes all of the selection onto one   texture, so be wary of overlapping UVs from different objects.
Go to Build->Export, and select the "Bake AO to PPM Image" (.ppm) file format and save to the file name of your choice. Anim8or will then generate the AO. You can track the progress in the console.

The .ppm format can be opened in image editors such as GIMP and Photoshop

Attribute Options:
AO_Width: (int [Default 128]) Sets the width of the texture in pixels (Default 128). Increasing this value slows render time greatly.

AO_Height: (int [Default 128]) Sets the height of the texture in pixels (Default 128). Increasing this value slows render time greatly.

AO_Samples: (int [Default 3]) Number of rays cast per pixel on a triangle (Default 8) . Increasing this value slows render time.

AO_Blending: (int [Default 0]) "Blurs" the results so that it's less pixellated (Default 0). The number represents the number of blur iterations. 0 means no blur. If you have very low samples, you'll want high (10-20+) blur. You can achieve this effect in an image editor, though the blending here automatically crops it to the uv cluster space.

AO_Padding: (int [Default 3]) Number of pixels that will be padded around each UV cluster (Default 3)

AO_Contrast: (float [Default 0]) Adds contrast so that lights are lighter (Default 0). 0 is no contrast, 0.5 is moderate, 1.0 is high, 1.5 is extreme, etc. Can also be done in an image editor.

AO_RayLength: (float [Default Variable]) Anything past this distance (in Anim8or Units) will not be detected as occluding the light. Useful if you want to have more or less geometry affecting the shadowing. If not set, the ray length is automatically set to 0.15*(diameter of bounding sphere)

AO_BGColor: (point3 [Default 255 255 255]) Background color of the image. Useful if you want to do your own blur or image editing.

AO_RayConeBounds: (float [Default 0.15]) Determines how close to the plane of the triangle a ray can go (example in image below). Clamped between 0 and 0.999

Ray Cone Bounds Effect

  • Optimize...where's my octrees?

Sample Images
Not much yet (yeah, it's that slow).

Warning: Best to treat this script as experimental. This script is very slow and practically primeval (hah...ahah...). If you want fast, high resolution AO, turn to something like xNormal. Otherwise tinker as you will :P

ASL Scripts / UVTools Preview
« on: February 12, 2014, 02:44:35 pm »
UVTools Preview

Welcome to another set of specialized scripts by yours truly. Ever want to export the UVmap of a model straight from Anim8or? Or better yet, view it directly within the Anim8or workspace?

Well, UVTools is a set of tools made to do just that!

What You Get
Create Canvas ("UVCanvas" parametric shape)
This shape creates a blank canvas, which is required if you want to use the next two tools.

Paint UVs Onto Canvas
This script paints the selected shape or faces onto the canvas. If nothing is selected, all shapes in the object will be painted. If there is no canvas, nothing happens. Only MESH shapes can have their UVs edited by these tools. Convert any other shape to mesh (including subdivision meshes) if you want to edit their UVs.

Apply UV Changes To Mesh
This script applies the UV coordinates represented on the Canvas back onto the mesh. If no canvas and/or no "context" exists, nothing happens.

View Vector
Creates a general UV canvas in the workspace, in the form of a parametric shape. Has options such as Width/Height (the ratio) and Shading (the darkness of the mesh overlay). You must mark a mesh in order to view its UVs on the canvas. This shape is not the same as "Create Canvas", and is only for viewing UVs. Basically, it's redundant and will probably be removed.

View Pixelated
More novelty than anything else. Creates a pixel-based canvas in the workspace, in the form of a parametric shape. Has options such as width, height, scale, and line transparency. You must mark a mesh in order to view its UVs on the canvas. Please note that Anim8or is really slow with generating meshes from ASL, so avoid using this on high-def meshes, and beware setting high width and height values.

View Vector on Left, View Pixelated on Right (as seen in the workspace)

Mark Shape
Mark which mesh(es) you want to view for the view-type scripts above. Do this by selecting the mesh(es) and going to Scripts->Mark Shape. Note that if you have nothing marked, nothing will appear on the UV canvas except a blank square.

Export PPM
Export your UVs to the .ppm format, which is compatible with image editors such as Gimp and Photoshop. To use this, select the meshes you want to export, or select none to export all of them. Optionally, create the "PPM_Width" and "PPM_Height" integer attributes to customize the export resolution. Exports as black lines on white background.

Example of an Exported PPM

Export SVG
Export your UVs to the popular Scalable Vector Graphics format, which is compatible with software such as Inkscape, Gimp, and Illustrator, as well as all modern web browsers. To use this, select the meshes you want to export, or select the faces you want to export, or select none to export all of them. If you select faces, and then select a mesh, it'll only export the selected faces of that mesh.

Example of an Exported SVG

Comes with these export options, in the form of object attributes you have to create:
  • (float - Default 0.5) SVG_InnerLineWidth : Width of the lines within a UV cluster
  • (float - Default 0.5) SVG_InnerLineOpacity : Opacity of the lines within a UV cluster
  • (float - Default 1.0) SVG_SeamLineWidth : Width of the seams of a UV cluster
  • (float - Default 1.0) SVG_SeamLineOpacity : Opacity of the seams of a UV cluster
  • (float - Default 0.3) SVG_MaterialOpacity : Opacity of each face, colored as its material diffuse color

If you view the exported SVG file in a modern web browser, you'll notice mouse hover effects. I'm investigating some form of interactive capability if viewed in a web browser, such as detailed information and manipulation.

How To Edit The UVs
The v1.1 release added the ability to edit the UVs of a mesh shape directly within the workspace. Here's a quick run-down of how to do so:
  • Create a UV Canvas - This is the parametric shape that has the button "UV Canvas", white on black. Only one canvas can be used at a time, so keep only one in the workspace.
  • (Optional) Assign a material to the canvas - If you want to edit the UVs on top of a texture, apply the material with its corresponding texture to the UV Canvas you had just created.
  • Select the meshes or faces that you want to edit - Only mesh shapes (Build->Convert to Mesh) can be edited by scripts, so only mesh shapes are detected by these editing tools. Select a mesh, or select faces within one or more meshes, that you want to "paint" onto the UV Canvas you made.
  • Go to Scripts->Paint UVs Onto Canvas - This "paints" the UV coordinates onto the canvas. In otherwords, it displays the UVs as if it were an image. The resulting mesh is called the "Context".
  • Edit the UVs - In point-edit mode you can select the faces, edges, and points of the painted UVs and move or scale them. Note: Do not use point operations such as knife, bevel, merge, etc., on these painted UVs. You'll mess things up. Seriously.
  • Go to Scripts->Apply UV Changes To Mesh - This applies whatever changes you made on the canvas back onto the mesh.

UV Editing

Some notes:
  • It's best if you don't rotate the Canvas or Context, and just work with it from the front view. You can split the views if you want to zoom at an angle on the origin mesh while working.
  • Again, don't perform mesh editing operations on the Context aside from move and scale. More UV editing tools like make seams, relax, merge, pack, etc., may come in the future, which is about all you could need. Also leave the origin mesh alone until you're done with the Canvas and Context
  • You can undo UV edits by hitting undo until you get rid of the unwanted point operations done on the Context. Then go to Scripts->Apply UV Changes To Mesh.

Your Feedback
These scripts are basic in concept and practice. However, I feel that they have potential. Pending whether you guys think it's worth pursuing, I'll add more features to these tools, to include:
  • UV Editing - Ability to edit the UVs of a mesh directly within Anim8or (in the same manner as programs like UVMapper
  • Better UV viewing - Texture underlay, easier method of selecting a mesh for viewing
  • Richer Export Options - More SVG styling options, UV clusters, padding, material-based export, texture underlay
If you want to give it a shot, download the attachment and install all the scripts into your Scripts directory that Anim8or autoloads from. If you have feature requests, bug reports, complaints, or ideas, post them here.

Demonstration Video (Download - 198MB)

v1.0 - 02/12/2014
  • Initial Release
v1.1 - 02/14/2014
  • Added UV editing tools - Paint UVs, Apply UVs, Create Canvas
  • Improved SVG Export
  • Added progress bar to Export Scripts and View Pixelated

ASL Scripts / XSI Export Script - LIA
« on: February 05, 2014, 01:13:57 am »

Okay, here's the XSI export script that supports hierarchy using the LIA system. If you're interested in having hierarchy, I recommend you download LIA v1.1 or later and use its tools to help you along the way.

  • Groups are ignored. The shapes within the groups are extracted and processed like any other shape. So if you have a shape named under the LIA system, and group it, it'll still retain its hierarchy.
  • Non-mesh shapes are treated as dummy shapes. Basically they'll have empty frames and otherwise be treated as another object in the hierarchy. So you can use splines to denote dummy shapes if you wish.
  • Transformations are "baked" into the vertices. Meaning that rather than the vertex data being relative to the shape's pivot point, all vertices are moved to its actual location in world coordinates. If there's demand for local transforms, I'll revisit this. If not, oh well.

Script is attached.

ASL Scripts / LIA - Links In Anim8or
« on: January 31, 2014, 04:15:22 am »
Links In Anim8or

Pseudo Hierarchy System

A while back I started this hierarchy thing, but never finished it. I restarted it and it's now in a releasable state. As mentioned in the previous topic, I don't expect this scriptset to be very useful to many. I wrote it only for the XSI export script. I expect this toolset to become redundant, assuming Steve implements native hierarchy support into Anim8or in the future.

What is LIA?
Anim8or doesn't have a hierarchy system in the object editor. This means that you can't set one object as the child or parent of another object. Yes, you can fake this using groups, but if you do it this way then any changes you make to an item deep in the hierarchy would require you to ungroup everything, change it, and then regroup it again, which is a lot of work ripe with the opportunity for error.

LIA is a simple naming system that appends ".ChildOf." to the name of a shape, which then tells whatever script that uses LIA that that shape is a child of whatever is named afterwards. If cube01 were a child of sphere01, cube01's name would be "cube01.ChildOf.sphere01".

With just this, a hierarchy system is born.

What is LIA good for?
Scripts that require hierarchy as a fundamental part of their features. For example, export scripts for formats used in game engines that require a certain parent/child relationship between various nodes. If you need to implement hierarchy in your script, pack the LIA scriptset with it and implement the preprocessor in your own script.

How do I use the LIA tools?
LIA currently comes with 5 tools, available in the Scripts menu in the Object Editor when installed correctly:
  • List Hierarchy - Prints out the current Hierarchy in the console
  • Set Parent - Marks the selected shape as the parent
  • Set Child - If a parent has been set, any selected shapes are then assigned as children of that parent
  • Unlink All - Clears all hierarchy information from all shapes in the current object, restoring their old names
  • Unlink Selected - Same as Unlink All, except only for those shapes that are selected

Warning: This is a system that relies on naming. If you get funny results, double check what you're doing. The console may print out some errors to help with troubleshooting, but the best way to use these tools successfully is to know exactly what you want, what these scripts do, and what the results should be.

How do I use LIA in my own scripts?
Doing so isn't quite as straightforward as I'd like. It's a naming convention, and all you have to do is follow the logic of how it works, as described earlier.

I mentioned the preprocessor. This is just what I call a block of code in the "LIA - List Hierarchy.a8s" file. In this block of code, it sorts it all for you into two arrays. If you loop through these from 0 to its size - 1, you get:
  • $LIA_sorted_index[index]: Returns the index number of the shape in presorted order. Use this number in the shape array that's returned when you use the [object].GetShapes() function.
  • $LIA_sorted_level[index]: Returns the level, to help you determine if the shape in $LIA_sorted_index is a child, sibling, or parent of the previous or next shape in the array.

Another useful array is $LIA_realNames. Using the same index number as the GetShapes() array, it'll return its real name without all the .ChildOf. mess.

Also included $LIA_locOffsets and $LIA_rotOffsets arrays, should someone need transform data relative to its parent rather than relative to the world.

Take a look at the List Hierarchy script for an example of its use. You'll find that the actual listing function is incredibly simple, and that all of the work is done in the preprocessor which you don't have to touch. Just copy the preprocessor block of code and the LIA-specific variable declarations, and you can use it in any custom script.

Pages: 1 [2] 3 4 ... 6