Voxelate Script

Hi Guys,
I've had a go at converting this script into a particle script. It's pretty much working but I have one problem. I want the first child of the voxelate script to be the object to voxelate and the second to be the voxel. The problem is that no matter what particle.setIndex() I set the particles seemed to get assigned round-robin to each child. This is my code:

var part=core.addParticle();
part.setPosition(p);
part.setScale(size);
part.setIndex(1);

Any ideas anyone?

Cheers, Tony
 

Attachments

  • ObjectBrowser.png
    ObjectBrowser.png
    19 KB · Views: 414
  • 3dview.png
    3dview.png
    214.3 KB · Views: 408
I managed to make a bit of progress with this problem. If I add a particle tag to the child object I want to voxelate and set frequency to 0.0 then it stops any of the particles from using that object. So... it works, but not ideal. I still don't understand why particle.setIndex doesn't work as I expect.

Cheers, Tony
 

Attachments

  • render.jpg
    render.jpg
    70.2 KB · Views: 422
hi

how about using addParameterfLink function to get reference guide object?

Code:
function buildUI(obj) {
  ...
  obj.addParameterLink("Voxel Base", true);
  ...
}

function buildObject(obj) {
  ...
  
  // L.56 - 73  
  var child = obj.getParameter("Voxel Base");
  if (!child) return;
  ...
}

Mesh Particle with [ type: volume ] make almost same object, but script version can express more variations as you want. :cool:

regards.

tg_jp, Hiroto.
 
hi

how about using addParameterfLink function to get reference guide object?

Mesh Particle with [ type: volume ] make almost same object, but script version can express more variations as you want. :cool:

Thanks Hiroto, addParameterLink looks like the best answer.

Mesh Particle is interesting. I'd not worked out how to use that before. Because it's not a script it is much much faster but it isn't quite as flexible.

Cheers, Tony
 
Back
Top