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"

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 ... 7 8 [9] 10 11 12
121
The object's pivot is accessible from scripts.  It would be possible to select points of a mesh and run a script to move an object's pivot to the center of the selected points so that any rotation or scaling of those points would be around the new pivot. Unfortunately, the script would have to be a command script since parametric scripts must return a shape.  That means that you would have to select your points, then run the script from the menu, then rotate or scale your selected points.

If there is any real interest, I will post a script (in the ASL section of the forum) to do that in the next couple of days.

122
ASL Scripts / Re: PrinttoString file function
« on: July 22, 2008, 10:36:18 am »
Bob,
Thank you for your input, but you have misread my post.  According to the updated scripting manual (after the 0.97b release), "PrintToString" is a new function that works similarly to the C function sprintf.  It is supposed to put the results of the formatting and variables into the string variable. 

In ASL, PrintToString is a member function of the "file" type.  My post above is pointing out that it returns the "undefined member reference" error when used as a member function.  Further, that it does NOT return an error when used by itself, but also does not return the string variable loaded with any result.

Therefore, I am either using the function incorrectly in some way, or there is a bug.


123
ASL Scripts / PrinttoString file function
« on: July 21, 2008, 06:46:59 pm »
Steve,
I cannot get the PrinttoString file function to work.  The following test script:
Code: [Select]
string $fname;
file $output;
$fname="$console";

$output.open($fname,"w");

string $tostring;
int $i;

$i=10;

$output.PrintToString($tostring,"test: %d",$i);
$output.print("%s\n",$tostring);

$output.close;

Gives "undefined member reference 'PrintToString'" error.  Interestingly, the line:
Code: [Select]
PrintToString($tostring,"test: %d",$i);does not give an error, but returns an empty string.

Your thoughts?

124
ASL Scripts / Attribute Type in Object Type
« on: July 21, 2008, 06:25:07 pm »
Steve,
With the 0.97b preview, you added the Attribute type to the Object Type.  What do you have planned for the Attribute type?  I have been using it in my scripts as a user input ability for command scripts, but I am hesitant to continue this practice if you have something else in mind.

If the attributes for objects is destined to become a user input ability, then would it be possible to add a "SetAttribute" method?  That way a script could preload the attributes and not require manual input, where typos are all too probable.

Are you also planning to add the Attribute type to Materials too? 

125
General Anim8or Forum / Re: OMG! I've lost everything
« on: July 15, 2008, 04:55:04 pm »
It is extremely unlikely that the drive is damaged.  I have been in the computer repair business since the late '80s.  Here is my suggestion: I would go to the computer store (circuit city, best buy, etc.) and buy a external USB connector (or enclosure) for the laptop drive.  You can plug it into another computer yourself and read off the important files.  The external USB connectors are about $5 on Ebay, enclosures are about $12 on Ebay.  Enclosures or external cables are $20-$40 at stores like circuit city:
http://www.circuitcity.com/ssm/NexxTech-2-5-Hard-Drive-Enclosure-NHDE25/sem/rpsm/oid/150788/rpem/ccd/productDetail.do

Even cheaper if you can wait for it to ship:
http://www.tigerdirect.com/applications/SearchTools/item-details.asp?EdpNo=1472797&CatId=3770

126
ASL Scripts / Re: Script: Copy "Source" mesh to "Target" mesh
« on: July 14, 2008, 03:17:20 pm »
It turns out that adding hihosilver's request to the script was more straightforward that I originally thought.  Attached below is an updated version of the script.  For comprehensive instructions on how to use the script see post above:

http://www.anim8or.com/smf/index.php?topic=906.msg6668#msg6668

plus:

12) Set the copies to use the original source mesh's materials and UV coordinates, or set the copies to use the target's materials.  If you choose to use the target's materials then the copy will take on the color of the target at the attachment point.  This is also true if the target's material at the attachment point is a texture.  It calculates the UV coordinate at the attachment point and assignes that UV coordinate to the whole copy.[usesourcemat].

Below are some examples of this new feature in action.  The first picture is simply a plane mesh with a cheetah skin texture on it.  The second picture shows the cylinder copied onto the cheetah textured plane.  It picks us the color from the texture and copies it to each individual copy of the source.  The third picture show how it will pick up simple color material and copy it to the individual copies of the source.

As always, your feedback is welcomed!

127
ASL Scripts / Re: Script: Copy "Source" mesh to "Target" mesh
« on: July 14, 2008, 10:35:50 am »
The transferring of the target's material at the point of the copy to the copy of the mesh is possible and I will work at putting out an updated script for that.  Keep in mind, though, that textures and UV coordinates will likely not transfer to the mesh copies predictably.

128
ASL Scripts / Re: Script Request: Chain Link Maker
« on: July 14, 2008, 10:05:40 am »
Sometimes I get that behavior too.  After verifying that the script actually ran by looking at the debug window, you might have to drag a little bit instead of just clicking in the modeling window.  If you are still having problems, post your .an8 file, and I will take a look.

129
ASL Scripts / Anim8ing a Tank Tread
« on: July 13, 2008, 09:57:12 pm »
I have posted a tutorial on how to animate tank treads using morph targets.  The concepts and scripts used can be applied to other projects as well.

The tutorial can be found at:

http://www.tranceportsoftware.com/anim8orstuff/treads.htm

Please let me know your feedback.

130
ASL Scripts / Re: Script: Copy "Source" mesh to "Target" mesh
« on: July 12, 2008, 11:35:28 pm »
I don't understand your request.  The script currently assigns the materials and UV coordinates of the source to all the copies.  Are you talking about assigning materials of the source to the target mesh?  Or are you talking about the materials of the target mesh being assigned to the copies of the source?  Either of these can be done.

If you could explain further, I will see what I can figure out.

131
I've actually already been thinking about that problem.  The main difficulty is that you cannot place objects in scene mode with a script.
 
One possibility:  Place each link of the track manually (or ex-program the way Terranim8or does), use a controller script to follow a path for the first link, then use controller expressions to calculate the position of the other links indexed off the first.  A lot of manual setup work or having to write an external program.

Another possibility:  Draw (using the copy_mesh_to_path) several complete tracks each offset such that the traversing of a single link is indexed until it is coincident with the next link.  Then animate using visibility controller scripts like is mentioned above.

Yet another:  write a new script to be run in the morph targets that takes a tread (made with the command version of the copy_mesh_to_path so that each link is a separate shape) and moves each link a bit to generate the several morph targets needed to move a single link distance (width) smoothly.  Then use morphing to create the animation.

There may be others, but I am going to look into the third possibility since it seems the most user friendly.

Your thought would be appreciated.

132
Just thinking about it...You could just use the position script and not use the orientation script.  That way you can use the normal animation keyframing methods for controlling orientation.  Unless there is some repetitive rule for the orientation behavior you are wanting, scripting is no better than manual.

Or perhaps, I am still not exactly grasping what it is you are wanting to do.

133
Yes, I guessed that was what kreator meant by roll, but I guess I didn't explain myself very well either.  Do you want to be able to specify a static roll (z-axis rotation) that stays the same throughout the traverse of the path, or do you want to be able to set a continuous rolling "tumble" at some rate relative to the traverse of the path, or both, or something else entirely?

BTW, this is fun, conferring about script functionality.

134
kreator,
I am not sure what you mean by roll.  Currently the script generates two controller scripts - one for position and the other for orientation.  The orientation is generated by reading the orientation of the spline.  Since the z-direction is along the spline, you effectively only get rotations about the x and y axes from the spline.  I could easily add a provision to generate rotations about the axes if I had a clearer idea of what you have in mind.
Do you want:
1) a static tilt relative to the spline?
2) a continuous rotation as it traverses the spline?
3) all the above, plus other stuff too?

If you can give me a vision of what you are looking for, I will sure attempt it.

Oh, and of course, you are very welcome!  I am glad to contribute to the greater glory of Anim8or!

135
ASL Scripts / Object Script that Generates Scene Controller Scripts
« on: July 10, 2008, 04:39:11 pm »
In response to a request from Kreator:

This script outputs to the console two controller scripts - one for position and the other for orientation - generated from reading the position and orientation components of a path.
   
This script requires Anim8or 0.97b or later.
   
The generated controller scripts must be cut and pasted from the console window (debug window) into the "Expression" areas of the controller of the scene element you wish to control.  NOTE:  this is necessary because Anim8or 0.97b broke the file export abilities.  Normally one would export these generated scripts to a text file, but the console is the only output currently available.  It is recommended that the properties of the console window be altered to allow more lines to be buffered.  Do do this:
1) Right-click on the title bar of the "Anim8or Debug Output" window, select "Properties"
2) On the "Layout" tab, increase the "Screen Buffer Size" to some large value (like 1000)
   
The number of frames that it should take to traverse the path must be placed into an integer attribute called "framesperpath" created in the object that contains the path.  If you want the path repeated continuously during the entire length of the the scene, an integer attribute called "repeat" must be created and set to 1 (set to 0 for no repeating).
   
Detailed instructions on usage:
1) Draw the path in a new object that you want followed
2) Go to Object->Attributes...
3) Select "New"
4) Type the name "framesperpath"
5) Select "Int" type
6) Type the number of frames for the path traversal
7) Select "New" again
8) Type the name "repeat"
9) Select "Int" type
10) Type either "1" for repeat or "0" for no repeat
11) Be sure the path is selected
12) Scripts->Run Scripts->path_to_controller.txt

The two scripts will be shown in the console window ready to be cut-and-pasted into the controller expression areas of the element you wish to follow the path.


Please let me know your feedback.

Pages: 1 ... 7 8 [9] 10 11 12