PDA

View Full Version : Special procedure to Layout Arrange/Distribute of nulls?



raw-m
08-27-2013, 03:55 AM
This could be very handy for generating nulls for Spline Control but I don't understand how to get it to work properly!

Got a Null.
Clone it 9 times.
Select "Null (10)" and move it down the Z.
Select my nulls from 1-10.
Arrange/Distribute/Along Z Axis

Get a strange order in way the nulls are spread along the Z. I was expecting Null 1 to be at 0, going incrementally through the numbers (2..3..4..5..) with Null 10 being the last in the chain. Instead, Null 9 is at 0, then goes 8..7.6.....1, with null 10 where I want it.

Is there a art to this that I'm missing? If not, is there a script that will rename or order my nulls in the SE based on Z distance?

Sensei
08-27-2013, 06:12 AM
Something like this?
https://www.youtube.com/watch?v=7MCLYvDlNS0

Here is 100 items example
https://www.youtube.com/watch?v=55FbTEh5ryg

evenflcw
08-27-2013, 07:18 AM
If it's just along a major axis you could do it via the scene editor property sheet - the edit property panel has features for setting values of multiple variables with an offset.

evenflcw
08-27-2013, 07:27 AM
Did you select the items in the right order? Right not necessarily meaning correct or as most people would expect. NT has unfortunatly been the worst at adopting selection-based assignment and has been unable to stick to a single standard (it doesn't help that the selection list is in reverse order internally to the order the user actually selected the items in). If it did not come out as expected, NTs dev simply picked another standard to interpret your intention based on the selection order. Just change your workflow to whatever willy nilly workflow the dev imposed on you.

Sensei
08-27-2013, 07:53 AM
Evenflcw, I have no idea what are you talking about.
LWInterfaceInfo->selItems[] array is in order user selected items in viewport, one by one.
I am using it in many tools. Align Items, Align Positions, Align Rotation, Align Scale, Cascade Parent. You can see it in above posted video tutorials, plus this one https://www.youtube.com/watch?v=z858jj8j5mc

What is mixing stuff is Scene Editor. If you select items in that window, order will be ignored, and they will show up in selItems[] like they're listed in Scene Editor (at least new one, have not checked old one, but suspect the same), so in alphabetic order.

Lscript have it reversed?

raw-m
08-27-2013, 09:35 AM
Something like this?
https://www.youtube.com/watch?v=7MCLYvDlNS0

Here is 100 items example
https://www.youtube.com/watch?v=55FbTEh5ryg

Sensei, brilliant, yes! ....I promise I've saving for your suite!


If it's just along a major axis you could do it via the scene editor property sheet

This would be another hidden gem in the SE to me. I've been through all the Property lists but can find the basic X,Y,Z co-ords anywhere! Am I being daft, can you tell me which tabs they are under?

I've tried selecting in the order I want in the SE and the Current Items box but no luck.

evenflcw
08-27-2013, 09:53 AM
To see and edit channel values you have to click the pluses to the left of the item names to expand and show their channels, and select Channel:Values sheet. Using channel filters makes selection abit easier. Still rather cumbersome.

raw-m
08-27-2013, 10:12 AM
To see and edit channel values you have to click the pluses to the left of the item names to expand and show their channels, and select Channel:Values sheet. Using channel filters makes selection abit easier. Still rather cumbersome.

Ah, that way! Yes, properly cumbersome, especially if you have loads of nulls, but I'll take it for now :D

I'm now getting that Distribute works OK if there is already an offset between the nulls so it can even out the spacing. Just not a lot of use naming/hierarchy wise if you're cloning an object which will obviously have the same co-ords.

raw-m
08-27-2013, 10:24 AM
Man, there is always something with this program! I duplicate a Null like 19 times. Under the channels tab I can easily filter out to only show the Z positions. Looks like I can really easily drag my mouse down the list to select all the relevant nulls. Great.

BUT......

The order in which the nulls are displayed are null 1, null 10, null 11...19, null 2, null 3, null 4..... Under the Items tab I at least have the options to cycle through the way the objects are displayed (ie, name, ID, Sequence....). No such luck in the Channels tabs which means I have to select everything in chunks! Grrrrrr....

evenflcw
08-27-2013, 10:47 AM
EDIT: nevermind...

evenflcw
08-27-2013, 11:11 AM
@Sensei: selItems[] is in order, but it IS reverse order compared to the users perceived order. If user ctrl-clicks Null(1), Null(2), Null(3) - Null(3) will be the first entry, ie with index 0, in that null terminated array. The last user selected item is the first in the sdks and lscripts provided array! Thus reveres order. It is perhaps somewhat of an academic question or an issue of personal perception (you could see it as a stack that stacks from the front, rather than a list appended to at the rear), as it doesn't hinder functionality one way or the other, but I do think it is less intuitive than the only other logical choice and leads to some minor issues! Consider restoring a previous selection. Now you can't simply store that provided array, recall it and go in order, SelectItem selItems[0], AddToSelection selItems[1]... , because that will reverse the selection since the order given was reversed in the first place! Instead you must first determine the length of the null terminated array and start from the back (or reverse the reverse order before hand). And what is the best way to store selections - should you store them in the original reverse order they were given, or the order you must call them to restore the original selection? It only leads to confusion and need to tippy toe and always check what direction the order of an item list runs. The only thing this design is good for is checking last selected item, as it will always be in the first field - but LW historically never utilized that, so that could not have been part of the design choice - which most likely was made arbitrarily.

raw-m
08-27-2013, 12:22 PM
Haven't tried I yet as not at my machine but found this, which hopefully still works on my mac!

http://earthwormjim.free.fr/lscript/layout/arrlay/index.html

raw-m
08-28-2013, 02:25 AM
Just a quick "heads-up". That script posted above is bloody brilliant!