General Category > ASL Scripts
Script: Copy "Source" mesh to "Target" mesh
kreator:
oh dear all that work NickE and they might not work in the future... I think I`ll hold onto 0.97B ... so that it continues to give me the tools that I need...... ;D
any progress with attached objects in scene mode ..... assume that would need to be done with controller script
hihosilver:
Luckily he provides a non-parametric script as well. Sorry if it's stepping over the bounds here! I hope you can provide a way to access outside meshes.
NickE:
Steve and everyone,
I will always write a command version and a parametric version, knowing that the parametric version will probably stop working at some point. With only ten parameters to work with, and larding all the points into a single shape, you are limited in what you can do in a parametric script.
NickE:
Attached is an updated and expanded version of the script. Following Steve's wishes, there is only a command version of the script. To use the script, you must edit it with a text editor to change the parameters. First, create a mesh named "target" to be the template where the "source" will be copied. Create a mesh called "source" to be copied onto the "target" mesh. The script is very highly documented, so you can always look at it in a text editor to see how it is constructed as well as the parameter explanations below.
Parameters:
1) Fixed rotations of the copies around the x, y, and z axes [xabsrot,yabsrot,zabsrot]
2) Variable rotations of the copies around the x, y, and z axes. The variable rotations are random up to half the amount entered plus or minus the Fixed rotations in (1) above.[xrot,yrot,zrot]
3) Fraction of available copy positions to be used. If you enter 1.0, all available copy positions are populated. If you enter less than 1.0, that fraction of the points will be randomly distributed. [meshptfraction]
4) Number of copies per available copy position. This can be a random number between a minimum and the maximum per copy position or it can always be the maximum number. [minusemesh,maxusemesh,usemeshrand]
5) Scale of each copy. This can be fixed at some value or random between a minimum and maximum.[minscale,maxscale,scalerand]
6) An offset to allow you to "sink" the copy into the surface of the target. It is entered as a fraction of the total y-axis length of the "source".[yoffsetfraction]
7) Set the original orientation of the copies to be either straight up and down along the y-axis or normal to the surface of the mesh at the copy position.[usenormals]
8) Set whether to use the unrotate "source" y minimum point as the attachment point to the "target" mesh or to use the new calculated y minimum point after all the rotations.[useorigmin]
9) Set the copy positions to be the vertices (mesh points) of the "target" mesh.[useverts]
10) Set the copy positions to be on the faces of the "target" mesh. If this is set, there will the number of sides of the face of the "target" mesh plus one: one in the center, and one each between the center and the vertices of the face.[usefaces]
11) A random seed to alter the random elements above. If you leave this the same, each time you run script you will get the same distribution of random numbers.[the integer in parenthesis of randseed]
To achieve the highest density for fur, hair, or grass, set the variable rotation, a relatively high number for maxusemesh, use the vertices and the faces. If you have a curved surface for the "target", use normals to have the copies point directly away from the faces and vertices instead of straight "up".
Enjoy!
I'd love to hear your feedback and suggestions.
hihosilver:
As before, this is an awesome script, and I have a request for it.
I'm wondering if there would be a way to have the script assign materials to a mesh, as in, an option to have the material already assigned to the mesh, or have the material of the face the mesh is assigned to (this may not work with having them come out of the vertices... perhaps an average and figure out which material or something.) I think it could be great though, especially with creating fur or something. Just an idea, not sure if it's possible.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version