Mesh Hose (Script Concept)

I have an idea for a Python script but have no time to try coding it, but I thought someone might like to give it a shot out there :slight_smile:

Here’s the concept:

To be able to “spray” objects into an area (based on user mouse movement), much like an image hose would work in a 2d application, taking a predefined set of images and then letting the user “paint” using those images. In this script we would be using meshes instead of images.

Purpose of script: To quickly populate scenes and build up large scale complex details without resorting to things like dupliverts, manual SHIFT D, particle objects, etc.

Imagine being able to “spray in” a forest, or an asteroid field, or a field of rocks and boulders, or a bunch of leaves or parts on a machine or a spaceship or a building.

Mechanics of script:

User loads “Mesh Hose” Python script in text window
User selects one or more mesh object(s) in scene to be sprayed. (Those objects would ideally be out of view/camera view so they could be easily selected yet not interfere with current scene.)
If no mesh is selected, script terminates and prints “No object selected” message to console
Maybe have script set a max number of verts permissible in each sprayable object mesh so a user doesn’t attempt to spray high poly objects in a scene (and therefore crash Blender). Maybe print message to console “[objectname] ignored: too many verts”
User positions 3d view cursor as the “reference point” and aligns view to focus on area soon to be “sprayed” with object(s)
Script
User runs script
As script runs, if LMB is detected an object is deposited at current mouse position.
If more than one object has been selected, the script cycles through them (deposting ObjectA, then ObjectB in next LMB cycle)
Script runs until ESC key is pressed.
If GUI is created for script, maybe to have an option for random rotation of sprayed objects (objects by default are sprayed according to their current rotation). Also a “randomize size” slider would be nice :slight_smile: A toggle “jitter” X/Y/Z range could also be set up so that sprayed objects can be further randomly placed throughout scene.

Anyway, I thought it might make for a fun and interesting project for someone out there :slight_smile:

RobertT

well an additional idea (just the handling)

you have the different objects selected… ok. now when you paint there should be a min. distance - setting, referring to the space between the objects. now the main idea:

you all know zbrush. connect the principle to this script. you start painting (lmb): the object occure (randomly) with “min. size”. you paint over them again and their sizes increase (depending on “presure”). now you can enlarge them to “max. size”. if you want them smaller, you shrink them (rmb)… again down to “min. size” and if you keep painting on them they disappear.

beside the possibility to spray them to the reference it’d be very usefull to paint them on an object.

yours, marc