Home   Help Search Login Register  

Author Topic: Selection naming script  (Read 1967 times)

0 Members and 1 Guest are viewing this topic.

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Selection naming script
« on: 08 Mar 2009, 23:02:47 »
Is it possible to write a O2 script that would automatically name multiple selected vertices by naming each with a incrementing number, like myselection_0, myselection_1,...myselection_n?
In case I'm confusing yous with my complete lack of terminology knowledge; I mean that if I for example add 200 'points' in the memory LOD I could name them with a script instead of doing it manually..

The scripting language confuses me completely due to lack of proper documentation (the O2 comref is not that helpfull) so I don't know if that's even remotely possible.  :dunno:
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Synide

  • Members
  • *
Re: Selection naming script
« Reply #1 on: 09 Mar 2009, 15:27:32 »
I think the commands your looking for are...

object forEachPoint [condition,operation,back]
sel selectPoint index
object save selection

... me thinks... possibly, oh heck, i dunno without doing it myself... maybe i'll give it a bash tomorrow...

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: Selection naming script
« Reply #2 on: 09 Mar 2009, 22:17:00 »
Thanks.  :good:

This whole thing wasn't as confusing as it originally seemed to be, but I'm not really getting anywhere..
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline Synide

  • Members
  • *
Re: Selection naming script
« Reply #3 on: 09 Mar 2009, 23:02:08 »
...but I'm not really getting anywhere..

k, i'll have a play & see what i can come up with...


eidt:

ok... here ya go, try this...

Code: [Select]
_lod=getActiveObject this;
_lod forEachPoint [{true},{_name="Synide_" + str(_x);_sel=newSelection _lod;_sel selectPoint _x;_lod save (_sel as _name);}];

obviously you'd want to change it to have a selection name starting with 'blah_' and i'd only run it in a lod with a smallish number of points like a memory lod, you'd probably guess running it in a 1.0 lod with 10,000 points wouldn't be healthy...
« Last Edit: 10 Mar 2009, 00:33:54 by Synide »

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re: Selection naming script
« Reply #4 on: 10 Mar 2009, 18:06:15 »
Brilliant, thanks! :clap:
Works like a charm.

When will I learn to keep it simple, I was going way too complex routes with this..  ::)
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.