Itoo Software Forum

Author Topic: Maxscript get positions from items  (Read 571 times)

GT4505

  • Full Member
  • ***
  • Posts: 133
    • claar.be
Maxscript get positions from items
« on: November 24, 2022, 12:06:15 AM »
Hi there,

I'm working on a project where I've got a lot of assets which I have distributed through railclone.
Now I want to reuse each distributed item's position (only position not the rotation).
I've baked my source objects, and want to put  an instance of the source object (baked) at the position of each object in railclone.

How can I access this position through maxscript? It should be possible as the railclone tools can instantiate the nodes... but I only need the position of each node so I can use this in my maxscript...

Thanks for the help!
Pieter
Pieter van Stee

iToo

  • Administrator
  • Hero Member
  • *****
  • Posts: 4388
    • iToo Software
Re: Maxscript get positions from items
« Reply #1 on: November 24, 2022, 10:44:02 AM »
Hi,

I'm afraid it's not possible to get that information from Maxscript.

In this case you're using RailClone as an instancer, where each item corresponds with an instance of the source object.
But we cannot guarantee this happens always. Usually an input segment may be sliced, deformed or transformed, generating different meshes. So, the output of RailClone is a collection of unique meshes and instanced segments.
For this reason doesn't exist a Maxscript interface for this. Instead, in Forest that is possible, because all output items are instances of the source objects.

Carlos Quintero
iToo Software

GT4505

  • Full Member
  • ***
  • Posts: 133
    • claar.be
Re: Maxscript get positions from items
« Reply #2 on: November 24, 2022, 12:14:41 PM »
Thank you for your reply.

In our case each node is exactly the source node, as I've checked "force instance" (I think it is).
However the source objects (trees) are lit from one, and the same side always.
In this case I'm using railclone to make more complex combinations and positioning objects more precisely, but each obj is (and should be) exactly the source object.

Therefore I'm actually only after each position of each node in railclone....
Is that possible?

Alternatively, which is less precise and quick I guess is to instanciate the objects through the railclone tools.
However here I lose the objectnames which makes it impossible to replace them in an easy way.

(see the attached image to see what I'm after)

Thank you
Pieter
Pieter van Stee

iToo

  • Administrator
  • Hero Member
  • *****
  • Posts: 4388
    • iToo Software
Re: Maxscript get positions from items
« Reply #3 on: November 24, 2022, 12:34:34 PM »
Ok, i understand. I will see what can be done for next updates.
We'll try to add a Maxscript interface which can be used both for your case, and for users who need to get all meshes.

Unfortunately there is not any standard feature which can be used for this purpose in the current RC version. Maxscript interfaces must to be specifically implemented.

Carlos Quintero
iToo Software

GT4505

  • Full Member
  • ***
  • Posts: 133
    • claar.be
Re: Maxscript get positions from items
« Reply #4 on: November 25, 2022, 01:50:50 PM »
ok, thanks for your reply...
Is there in the mean time a possibility to use just one type of object in a rc, and then through the rc tools to instanciate them onto a layer, and from there on I can go replacing them with maxscript again...
I think through UIAccessor? if I'm right?

Thanks
Pieter
Pieter van Stee

iToo

  • Administrator
  • Hero Member
  • *****
  • Posts: 4388
    • iToo Software
Re: Maxscript get positions from items
« Reply #5 on: November 28, 2022, 12:26:37 PM »
Yes, i think there are Maxscripts to replace one object by other.
But, why not use that object directly in RailClone ? I mean, RCTools will instantiate them on a single step.

If you want to use a low poly object as preview (instead the final), just assign both in RC using a Selector node. Assign a parameter to the Selector Index, and change it before applying RC Tools.
Carlos Quintero
iToo Software