xpresso for instancing scatter node- obsolete

Maxon Cinema 4D (Export script developed by abstrax, Integrated Plugin developed by aoktar)

Moderators: ChrisHekman, aoktar

User avatar
bepeg4d
Octane Guru
Posts: 10356
Joined: Wed Jun 02, 2010 6:02 am
Location: Italy
Contact:

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 8161 times
after
after
Schermata 08-2456164 alle 19.48.34.png (10.27 KiB) Viewed 8161 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 403 times
Last edited by bepeg4d on Tue Sep 04, 2012 5:03 pm, edited 2 times in total.
User avatar
LudovicRouy
Licensed Customer
Posts: 216
Joined: Sat Apr 03, 2010 5:05 pm
Location: FRANCE
Contact:

I will look at this... thanks for your help
User avatar
LudovicRouy
Licensed Customer
Posts: 216
Joined: Sat Apr 03, 2010 5:05 pm
Location: FRANCE
Contact:

Oops can't open this scene with my old 11.5 release... :cry:
User avatar
bepeg4d
Octane Guru
Posts: 10356
Joined: Wed Jun 02, 2010 6:02 am
Location: Italy
Contact:

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
User avatar
LudovicRouy
Licensed Customer
Posts: 216
Joined: Sat Apr 03, 2010 5:05 pm
Location: FRANCE
Contact:

That's kind to try but I will upgrade C4D to R13 in the nexts days ;)
User avatar
bepeg4d
Octane Guru
Posts: 10356
Joined: Wed Jun 02, 2010 6:02 am
Location: Italy
Contact:

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 369 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
User avatar
LudovicRouy
Licensed Customer
Posts: 216
Joined: Sat Apr 03, 2010 5:05 pm
Location: FRANCE
Contact:

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-)
User avatar
bepeg4d
Octane Guru
Posts: 10356
Joined: Wed Jun 02, 2010 6:02 am
Location: Italy
Contact:

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
Post Reply

Return to “Maxon Cinema 4D”