A python script for Blender that I have long wanted to perfect, but lacked the time. Also the function it performs is difficult to explain, it is similar to the current shrinkwrap modifier but it keeps the normal based displacement from destination surface roughly equivalent to the source. Meaning, with shrinkwrap, a pipe will be flattened, but with this script it still will be a pipe. I believe the image below is a perfect example for its usage, using it to align some “pipes” to a generated terrain.
Since this script is kind of difficult to use, the following is a quick tutorial on basic usage:
- First step to using this script is installing it into your blender’s scripts directory. Once dmn_wraptop.py is copied there
you can access it from the Object’s Scripts sub-menu.
- Now you need to have the object you wish to project to ready for action. Make sure there is at least one UV layer selected.
- Use the first feature of the script called “Create UV line guide from selected”, and an object made entirely of lines should be created,
that is your “uv guide”.
-You have two choices, selecting the uv guide object going into edit mode and creating your mesh that way, or using another mesh and joining it to the uv guide mesh.
Either way the “Source Mesh” must include the uv guide for the script to function properly.
- Time to use the “Process wrap-project with selection” function while having the source and destination meshes selected. Depeding on the number of faces of the objects
this function can be slow. Progress updates will be shown in the console window as text.
- Now you should have the object wrapped around the object correctly, if errors occur, make sure that you stayed within the uv space where visible faces are. You can delete, adjust and reprocess until satisfied. In the example below taken from the included EggSample.blend file, the generated mesh was moved for better visibility, in reality the script generates the object in the same space as the “Destination Mesh”.
In addition to the tutorial above, I thought of a better way to explain why this script is necessary, and what are the main benefits. Imagine that you are trying to create a pipe like object on a mesh’s surface that curved to the topology. You currently have three choices: Shrinkwrap(Retopo), Displace Map, and Wrap To Projection. Retopo flattens all dimensions, displacement allows only half of the dimensions, while using this script you can keep the top and the bottom of the pipe without distortion.