Page 1 of 2

xpresso for instancing scatter node- obsolete

Posted: Fri Aug 24, 2012 6:07 pm
by bepeg4d
here is my little utility for working with c4d R13 and the last test version of octane with instancing support, and in particular with the scatter node.
it's not a very confortable solution but it's possible to play with instances waiting for a more professional and confortable one.
basically there are two null objects with an xpresso tag.
the "select&scatter" object has a user data section with an imput object field, you can drag any object in it from the object menager or pick it with the proper dropper. now you can copy and past the 12digit string inside a scatter node or in the text field below, where it's possible to store several strings of different position, rotation and scale of different instance.
Schermata 08-2456164 alle 19.47.19.png
the "clone&scatter" works in a similar way but with cloners.
when a cloner is dragged inside the first field, the total number of copies is displayed and is possible to choose a specific clone and obtain the 12digit string.
the max number of copies depends exclusively from your patience :)
Schermata 08-2456164 alle 19.47.37.png
important note: it's extremly important to setting up the correct rotation order (YXZ) in the upper right corner of the viewport, otherwise the 12digit string is not correct.
before
before
Schermata 08-2456164 alle 19.47.47.png (9.9 KiB) Viewed 8263 times
after
after
Schermata 08-2456164 alle 19.48.34.png (10.27 KiB) Viewed 8263 times
unfortunately the correct rotation order is lost every time that the nulls are pasted in another scene and i'm not able to solve this issue without the workaround of the hud in viewport :(
happy rendering ;)
ciao beppe
octane-scatter-v03.c4d.zip
(94.3 KiB) Downloaded 409 times

Re: xpresso for instancing scatter node

Posted: Sun Aug 26, 2012 10:37 am
by LudovicRouy
I will look at this... thanks for your help

Re: xpresso for instancing scatter node

Posted: Sun Aug 26, 2012 10:44 am
by LudovicRouy
Oops can't open this scene with my old 11.5 release... :cry:

Re: xpresso for instancing scatter node

Posted: Sun Aug 26, 2012 9:23 pm
by bepeg4d
I'm sorry, c4d R13 only :(
ciao beppe

Re: xpresso for instancing scatter node

Posted: Wed Aug 29, 2012 5:57 am
by bepeg4d
i've tried to transfer the xpresso to r12 first, but it seems that it's not possible with the same approach. i can't find a way to specify the rotation order for the matrix so the 12digit string is not correct :(
ciao beppe

Re: xpresso for instancing scatter node

Posted: Wed Aug 29, 2012 5:17 pm
by LudovicRouy
That's kind to try but I will upgrade C4D to R13 in the nexts days ;)

Re: xpresso for instancing scatter node

Posted: Wed Aug 29, 2012 9:58 pm
by bepeg4d
very good choice :D
ciao beppe

Re: xpresso for instancing scatter node

Posted: Fri Aug 31, 2012 3:34 pm
by bepeg4d
ok, another step forward towards the full usability of the scatter node with c4d :)
now is possible to obtain automatically all the matrices of the clones of a mograph object, it's a bit tricky but it works.
here is the procedure:
- download the "octane-scatter-v04.c4d" attached to this post
- copy and paste the two null objects with the xpresso tag in your scene
- very important, select the YXZ rotation order for both the xpresso in the hud of the viewport, otherwise the generated matrix is not correct
- drag the cloner to be scattered in the proper field in the user-data tab of the "clone&scatter" object
- read the total number of clones in the field just below and use it to set the duration of the animation in the timeline subtracting one frame
- go to frame 0 and set a keyframe with the value of 1 in the field just below
- go to the last frame and set a key with the value of the total number of copies
- go to the animation menu and set the play mode to simple to avoid the loop
- open the console window in the script menu and clear the content from the file menu inside the console
- click play and voilĂ , in the console appear the matrices already formatted and ready to be paste in the scatter node

note:
- the last matrix is repeated twice (you can erase it directly in the scatter node), probably caused by the automatic stopping of the animation. in fact it's really important to do the last two steps consecutively and do nothing in between, otherwise some undesired matrices are written in the console
-there is a limit of 999 lines to be displayed at one time in the console window so if the total number of copies exceeds the limit, it's necessary to set the animation to 0-998, then 999-1998 and so on.
-unfortunately the xpresso is quite slow to execute, but you can play with octane meanwhile :)
here is the file:
octane-scatter-v04.c4d.zip
(178.37 KiB) Downloaded 373 times
and here is an example of a pine in a mograph with 961 clones over a landscape object:
Capture-treescatter-01.PNG
ciao beppe

Re: xpresso for instancing scatter node

Posted: Fri Aug 31, 2012 4:57 pm
by LudovicRouy
You've done a great job, I think I'm gonna use part of your working process to make a coffee expression or a plugin if I'm good enough to write it...

I must be patient my R13 is so near nowww 8-)

Re: xpresso for instancing scatter node

Posted: Fri Aug 31, 2012 8:06 pm
by bepeg4d
thank you ludovic, i'm more than happy if you or someone else can use part of my xpresso for getting something more professional and comfortable for get full advantage from the instancing, i was waiting from a long time and now i can't wait of using them in my renders and animations :D
ciao beppe