Anim8or Community

Please login or register.

Login with username, password and session length
Advanced search  

News:

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.

Messages - NickE

Pages: 1 2 3 [4] 5 6 ... 11
46
Thank you, Steve.  It seems to have cleared the bug.

47
Steve,
   I have attached an an8 file and a texture jpg.  Once the file is opened, simply double clicking the mesh (battery model) to open the "Mesh Properties" dialog, then clicking "OK" will clear the materials.  I get the same results whether I alter any of the properties or not.

As far as ASL is concerned, I am still testing the newest capabilities.  If you don't mind, I will reserve my ASL wish list for another post so I can put my thoughts together as clearly as possible.

Thank you so much!

48
In Object Editor, if a textured mesh is double-clicked to bring up the "Mesh Parameters" dialog box, when the "OK" button is clicked, the mesh loses references to its materials.  The UV coordinates are not lost, but the mesh's face references to individual materials are lost.

I first noticed this in Build 1086 and it persists in Build 1088.

A close look at the an8 file before and after shows that the "materiallist" has had the materials removed (leaving only the {" -- default --"}. Further, in the "faces" section, individual references to the materials are set to zero.  The materials are still in the object, just no longer associated with the mesh.

Thank you for continuing development on Anim8or.  I have been using it continuously since 2007.

I am especially looking forward to more ASL development.


49
Ongoing Anim8or Development / Re: ASL Functions
« on: February 26, 2014, 12:14:26 pm »
Wow, Steve, this is awesome!  What do you think about an #include type command or a linker type command that allows us to build libraries of functions in a separate file for easier reuse?

50
cooldude234,

Whenever I have tried to determine whether a line segment (like an edge) intersects a polygon, I have done it in two steps:
1) determine if and where the line segment intersects the plane of the polygon
2) determine if that intersection is actually inside the polygon

It is unclear from your code segment what Ray1 and Ray2 actually are, but if they are points that define a line segment, then this is how I would solve this problem:


   facenormal=normalize(crossproduct(vert3-vert2,vert2-vert1))   //get normal of polygon plane
   rayvector= ray2 - ray1                                        //get vector of ray line segment
        ray_plane_angle=dot(facenormal,rayvector) //actually the arccos of the angle between
        if ray_plane_angle != 0                   //if zero, the two are parallel
            ray_plane_intersection_point = ray2 + ((dot(vert1 - ray2,facenormal) / ray_plane_angle) * rayvector
            //above, calculate the intersection point of vector of the line segment and plane
            //next add angles of intersection point to two of the vertices at a time.
            //if the angles add to 360 deg (or 2*pi rad) then inside, otherwise the intersection point is outside
            total_angles= acos(dot(normalize(vert1-ray_plane_intersection_point),normalize(vert2-ray_plane_intersection_point)))
                         +acos(dot(normalize(vert2-ray_plane_intersection_point),normalize(vert3-ray_plane_intersection_point)))
                         +acos(dot(normalize(vert3-ray_plane_intersection_point),normalize(vert1-ray_plane_intersection_point)))
            if (abs(total_angles - 2*pi) < 0.001) contact_point=ray_plane_intersection_point

If you are actually dealing with a line segment, rather than an endless line, then you need to check whether the intersection point is actually between ray2 and ray1:
           
            if length(ray2-ray_plane_intersection_point)+length(ray1-ray_plane_intersection_point) > length(ray2-ray1)
                //intersection point is not between ray2 and ray1


I wrote the code in pseudo code rather than a particular language.
I hope that helps.
NickE

51
Anim8or v0.98 Discussion Forum / Re: Feature Request Thread
« on: June 12, 2013, 07:40:34 pm »
@ianross,

As kreator mentioned, Boolean operations are available via ASL script.  Kubajzz and I both did a different approach.  I cannot remember if I ever posted my version.  I attached mine below.  Please read the header to the file for instructions.

NickE

52
Anim8or v0.98 Discussion Forum / Re: Feature Request Thread
« on: June 05, 2013, 11:14:22 am »
Raxx,
The file write ability has many, many more uses than just passing parameters (like writing entire an8 files), plus setting an attribute is not going to let you pass anything large like arrays. 

An object script controller would be a scene controller like position, orientation, or morph, but allow one to run object scripts while in scene mode where the object script would have access to scene mode variables like time or frame and access to the other scene's objects controllers.  I have written fluid simulation and other "physics" scripts that run in object mode.  To use them in scene mode requires quite the workaround to render them.  Please see this thread:

http://www.anim8or.com/smf/index.php?topic=2358.msg17352#msg17352

NickE

53
Anim8or v0.98 Discussion Forum / Re: Feature Request Thread
« on: June 03, 2013, 08:49:57 pm »
If I could beg for a single ASL update for the next preview, it would be file.read member function(s).

Here's why:

It would be a work-around for most of the other items on the scripting wish-list. 
(1) One could read and write Anim8or project files allowing one to do particle animation, fluid dynamics, and physics by generating objects and morph targets and scene object placement and controller values, and so much more!
(2) One could simulate parameter passing between scripts
(3) Custom import filters

Once a file.read ability exists, the only thing needed to have robust access to all of Anim8or's modes would be the ability to trigger another script's execution from within a script.  (more begging here)  Even the simplest implementation would be sufficient: completely terminate the original script and begin execution of the requested script.  The file read/write functions can be used to simulate user defined functions ability.

Those two additional functions - file.read and script.execute - would open the door to the development of libraries of script functions like physics, walk sequences, mouth movement, lip synch, etc.

If I could beg for another:

I would like to request that an "object script" controller be added in scene mode with access to the scene variables of time,  frame, and other scene controllers.  If this were done, the full range of physics would be possible in Anim8or!


54
ASL Scripts / Re: BVH File Import into Anim8or
« on: June 02, 2013, 03:44:22 pm »
A user (Daniel) found a set of BVH files that could not be converted with the current version.  Those files had 6 channels for each bone as opposed to the normal 3 channels.  It was causing the program to crash.  An updated version is attached.

Feedback is appreciated.

55
ASL Scripts / Re: Anim8ing a Tank Tread
« on: September 01, 2011, 09:04:19 pm »
Arik,
Sorry it took me so long to get to this...

I looked at your attached file and there are several reasons why you are getting this behavior.

1) The script looks at the path and reads the orientation of path at the points where it is going to copy the "copytarget".  If you adjust the individual points on the path in different views, you can inadvertently change the orientation of the path in totally unpredictable ways.  For treads (and similar things), I used the Build->Primitives->N-gon to make a circle and then stretch it out.

2) Your "target" object's pivot was at the origin of the screen rather than in the center of your object.  Your object's orientation is measured from this pivot.  The only way to move that is using the Object/Axis button and manually moving it to the center of the object.

3) Your "target" object's origin was also at the screen origin, rather than your point zero.  I have attached a script that will "fix" the internal coordinates to the apparent coordinates of any highlighted mesh.

I have also attached the original project with an additional object containing the fixed path and object so that the scripts work properly.


56
You touched me.  I love the poetry, and the presentation was world class!  Go professional.  You have a promising career ahead of you.

57
ASL Scripts / Re: BVH File Import into Anim8or
« on: May 13, 2011, 08:52:04 pm »
I have attached an updated version of the BVH Import program.  It automatically adds a bone to attach a single mesh.  This bone is called "0_object_bone".  When in Figure Mode, if you click on "List Items" button, it will be the first bone in the list.  Click on that item in the list to select it, and then do the "Build>Add Object" to attach the mesh to this "root" bone.  Then it is just a matter of weight painting.

The program is also a little bit more intelligent about keeping the axes from flipping.  It doesn't always work, but it is a lot better.

Feedback is always appreciated.

58
ASL Scripts / Re: ALIGN POINTS SCRIPT - Help need
« on: May 13, 2011, 08:41:53 pm »
Neirao,
Below is your code with the changes you requested:
Code: [Select]
/*
  *Name: Aling points to (x,y,z)
  *CopyLeft: 2010
  *Author: Neirão
  *Date: 03/03/10
  *Description: based in Vytautas_alinhar_pontos_line_points_v1
  *Parameters:  *= width;  *= height;  *= width_divisions;  *= height_divisions;
  */

/***** Init *****/
#command("object");
object $object;
shape $shapes[0];
shape $shape;
int $shape_count;
point3 $points[0];
point3 $point;
int $point_count;
int $i;
int $j;
int $direction;

/* added by NickE */
point3 $sel_max,$sel_min,$sel_center;

/* end of added by NickE */

if (GUI.Xenabled) $direction = 0;
else if (GUI.Yenabled) $direction = 1;
else $direction = 2;

if (GUI.Xenabled && GUI.Yenabled && GUI.Zenabled) $direction = 3;

meshdata $mesh_data;
$object = project.curObject;
$shape_count = $object.GetShapes($shapes);

/*** Get all selected points from all the shapes ***/

for $i = 0 to $shape_count - 1 do{
$shape = $shapes[$i];

/* If shape is a mesh.. */
if($shape.GetKind() == SHAPE_KIND_MESH){

/* i try this..but dont work.. :( --> || $shape.GetKind() == SHAPE_KIND_SUBDIVISION */

/* Get the shape point number */
$point_count = $shape.GetNumPoints();

/* added by NickE */

        $sel_max=(-10000,-10000,-10000);
        $sel_min=( 10000, 10000, 10000);

        for $j = 0 to $point_count - 1 do
        {
           if ($shape.GetPointSelected($j))
           {
              $point = $shape.GetPoint($j);
              if ($point.x > $sel_max.x) $sel_max.x = $point.x;
              if ($point.y > $sel_max.y) $sel_max.y = $point.y;
              if ($point.z > $sel_max.z) $sel_max.z = $point.z;
              if ($point.x < $sel_min.x) $sel_min.x = $point.x;
              if ($point.y < $sel_min.y) $sel_min.y = $point.y;
              if ($point.z < $sel_min.z) $sel_min.z = $point.z;
           }
        }
        $sel_center.x=($sel_max.x + $sel_min.x)/2.0;       
        $sel_center.y=($sel_max.y + $sel_min.y)/2.0;       
        $sel_center.z=($sel_max.z + $sel_min.z)/2.0;
/* End of added by Nick E */       
 
for $j = 0 to $point_count - 1 do{
if($shape.GetPointSelected($j)) {
$point = $shape.GetPoint($j);
if($direction == 0){
/* $point.x = 0; */
                        $point.x = $sel_center.x;   /* Added by NickE */
}
if($direction == 1){
/* $point.y = 0; */
                        $point.y = $sel_center.y;   /* Added by NickE */
}
if($direction == 2){
/* $point.z = 0; */
                        $point.z = $sel_center.z;   /* Added by NickE */
}
/* TODOS XYZ ATIVADOS alinha todos para  */
if($direction == 3){
$point.x = 0;
$point.y = 0;
$point.z = 0;
}
$shape.SetPoint($j, $point);
}
}
}
}

Some things to think about:
1) Do you really want the center, or do you really want the average?
2) This script works on the actual coordinates of the points, so if a mesh is moved or rotated, it still operating on the underlying point coordinates rather than the transformed coordinates.  This may give different results than what is expected.


59
Anim8or Challenges / Re: Challenge #25: 1000
« on: April 25, 2011, 09:12:44 pm »
There are 1,000!  Count 'em, hehe.

60
ASL Scripts / BVH File Import into Anim8or
« on: March 20, 2011, 01:07:09 pm »
Attached below is a working BVH file import program for Anim8or.  For those that are not familiar, BVH is a motion capture file format that describes a skeleton made up of joints (points) and a timeline of XYZ Euler angles that describe the rotation of the joints.  See http://www.cs.wisc.edu/graphics/Courses/cs-838-1999/Jeff/BVH.html for an overview of the description.

Anim8or differs widely from the BVH file format in that Anim8or's Figure Mode uses bones for the skeleton where the orientation of the bones is described by a quaternion.  The Sequence Mode uses XYZ Euler angles to describe the change in orientation of the bone relative to the initial orientation of the bone set in Figure Mode.  In Anim8or, the rotation of the bones, when unconstrained, goes from -360 to +360 degrees.  Conversion to and from quaternions and Euler angles requires the use of trigonometric functions.  The atan2 function, for example, goes from -180 to 180 degrees.  A small change in angle in the BVH file across one of these trigonometric limits can trigger Anim8or to flip the bone 180 degrees.

Anim8or has bugs in calculating the frames between keys.  Sometimes it will interpolate wildly. 

Scene Mode has a bug (or maybe it is intentional) where the root bone orientation is completely ignored.  Since the root bone orientation is the orientation of the entire figure, the bug is overcome by keying the root bone orientation into the orientation controller of the figure in Scene Mode.

Sequence Mode has no translational motion abilities, so the BVH translation is keyed into the position controller of the figure in Scene Mode.

The program can currently read in a BVH file and create an Anim8or project file (an8).  This means it generates a skeleton in Figure Mode, a sequence that uses the skeleton, and a scene containing the figure and the sequence.  It keys the orientation and position for the figure directly in scene mode.  For reference, the program also generates a simple line object in the same position as the skeleton.  I found this useful for getting the size and posture of the object to be skinned close.

BVH files sometimes have issues as well.  Most of the Carnegie-Mellon BVH repository files have zero-offset joints.  This introduces some small error when these zero-offset joints have rotations.  Many BVH files have skeletons of very small scale.  I have added a scaling function to the program to allow you to modify the overall scale of the skeleton.  Many of the BVH file have frames-per-second (FPS) of 30, 60, or 120.  I have added the ability to change the FPS.  Please realize that the recalculation of the FPS requires computational interpolation of the motion.  I am using simple linear interpolation in that calculation that introduces some error.  To reduce the number of keys (to reduce file loading time), the program allows you to choose how often to key the original motion as well as put in a tolerance factor to not key when there is change less than this tolerance factor.  In BVH files that have a lot of fast motion, you will need to key more often.  One martial arts BVH file I tested required every frame to be keyed or significant motion error occurred.  Loading that 650 frame Anim8or file takes about 4 minutes on my computer.  Some BVH files have a first frame that is zero motion (original skeleton pose).  There is an option in the program to skip this frame in the sequence and scene.

Some minor tweaking in Anim8or is often necessary due to the fact that trigonometric functions change rapidly near the limits.  This relatively easy to do.  A BVH file I tested that had a runner turning a 90 degree turn worked fine except the right upper arm was slightly off.  A small adjustment in Figure Mode was all that was necessary.

While the program works pretty well for what it does, the results of the program are not readily portable or incorporated into existing projects.  The final product is in Scene Mode.

The program is written in VB6, so you might need to download some runtime libraries if your computer does not already have them.

Please play with the program and give me your feedback and ideas on how to make this more useful to Anim8or users.

Some hasty examples done with figures from BobIt's figure plugin are posted on youtube:

Chinese Martial Arts:  youtube.com/watch?v=KG9hBBvjoDo[/youtube]]http://www.


Hooker Walk: youtube.com/watch?v=3_AjJkl6qzk[/youtube]]http://www.


Thank you.

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