Jump to content

Falloff-based selection of clones... is it even possible?


JustinLeduc
Go to solution Solved by noseman,

Recommended Posts

Hey guys! Happy new year! 🙂

 

I have what I believe to be an interesting problem I've been trying to solve for a few days now. I'm starting to think it's simply not possible, but stubborn as I am, I keep hoping it's not.

 

Goal: I have an array of clones and I want to dynamically select some of those clones based on: 1) their falloff direction 2) the position of the Camera. In other words, I want the selection of those clones to "stop" as soon as 1 clone is found/selected in its given direction.

 

For example, take this simple array of clones (no active Camera):

 

PCil2h4.png

 

Now from the perspective of a given Camera, I want to dynamically select (for example) the top row of clones, regardless of their XYZ position in the World, as such:

 

yKL5cyd.png

 

The Mograph Selection tool was used to better demonstrate the desired effect.

 

Or, the right clones:

 

UocRnUh.png

 

My question is: Is this even possible, and if yes, how?

 

As you can see, this isn't a matter of a simple Linear Field. I want a Field (or any other approach that works) to only select the first clone "found" in a given direction, regardless of its XYZ position.

 

Any insight or tip would be immensely appreciated!

 

Thanks a ton guys! 😁

 

P.S. I've attached the project file in case it's useful to anyone.

CLONER_PARAMETRIC_SELECTION_V001.c4d

Link to comment

You are trying to select a row of clones, however "row" of clones is not present anymore after you apply random field. Why not use linear field to make a selection prior to applying random field? Alternatively you could find a closest clone and expand a selection based on some rule.

Link to comment
  • Customer

What you're asking for is a 2D Camera Projection Falloff.

I've suggested something like this in the past. It involved SceneNodes.

 

Since there isn't something like that implemented you'll need to construct it yourself.

The camera's frustum is a pyramid so with this in mind I constructed a field that is a child of the camera to be on par with it.

Note that I'm working in R20 and the Use Fields in the MoGraph Selection hadn't been implemented at that time, so I tried to affect clones directly. You can add them later.

Unfortunately there is no Pyramid Field, so I used a Pyramid object as a Point Object Field. Well that didn't work either because the Invert Layer Effect apparently does not apply to generic Point Object Field. I don't know if this has been resolved in later C4D versions. So I had to be more creative.

 

I don't use Octane, I'm not sure how much that will affect your project.

 

Use the From parameters in both Tubes to affect as many rows or columns you like from the camera's point of view.

image.png.6a5b9498c6687d240edc281a89d8551f.png

 

Affecting objects from camera.c4d

Edited by HappyPolygon (see edit history)
Link to comment

@HappyPolygon @Havealot @Hrvoje I can't thank you enough for wanting to assist me with my problem. I really appreciate it, truly.

 

While I feel like you guys get the gist of my issue, I feel like I perhaps didn't do such a great job of illustrating my problem. While I'm not allowed to share the actual project file I'm working on, I made another project file (see attachment) that is a bit closer to what the real NDA-restricted project file looks like, but much simplified of course.

 

Take this teapot, for example. It was built from an imported point cloud of a teapot that was then inserted in a Object Cloner.

 

rpZSIgd.png

 

As stated in my first post, from the perspective of a given Camera, I want to dynamically select (for example) the top row of clones based on their Normal direction, as such:

 

UCuHcSh.png

 

Same thing from, let's say, the right:

 

l96wILW.png

 

What I'm dealing with in my NDA-restricted project file is an animated point cloud, so there's no way I would ever want to manually select each clone for each frame of the animation.

 

Solution (but undesired): So far, the only way I've managed to make this work is by using Power Cloner, which allows me to "raycast" cubes onto my Cloned object (teapot in this instance) from any angle I want, then use the "collisions" between Power Cloner's raycasted cubes and Cloned object (teapot) as a "Point Object Field" Layer in the Shader Effector, which allows me to precisely color any side of the Cloned Object. This is all good in theory, but unfortunately, in practice, it is slow and clunky, which is why I've been seeking for a better solution for a little while now.

 

Thank you so very much once again. While I have very little XPresso knowledge, I'll give this a try, @Havealot. Thank you!

CLONER_PARAMETRIC_SELECTION_V002.c4d

Link to comment
  • Customer

Oh... well that raised the difficulty bar to new heights ...

 

Yes you do need a ray-cast. A bunch of splines casting towards a direction until they hit something. Make them all line-up linearly and use them as a field.

 

It definitely can be done with Scene Nodes, not in S22. Maybe ricochet can do that for you.

Edited by HappyPolygon (see edit history)
Link to comment

@HappyPolygonAlright, thanks a ton for at least confirming my suspicions about needing a raycast-type solution.

 

Power Cloner does the job pretty well for what it is. Ricochet crossed my mind a while back, but I forget why I never gave it a shot. Power Cloner is a bit old and hasn't been updated in a while, so Ricochet might be more CPU-efficient. I'll definitely try it out.

 

Thanks a ton once again!

Link to comment
  • 2 weeks later...

@JustinLeducI replied on Twitter with a short Video anti-tutorial.
Even Raycasting won't solve your problem in the case of the Teapot as it would either obscure the body of the pot on the LEFT if you consider "shadows" or if no shadows, it will include the inner part of the handle in the RIGHT selection.

As I see this, it's not possible to do that procedurally. Having said that, depending on the final model and how much you can deviate from the original idea, something similar may be possible... but needs a bit (a lot) of R&D.

Link to comment

Hey @noseman,

 

"anti-tutorial". Ah!

 

I can't thank you enough for the video you've made on Twitter. I'm very grateful for the well-worded insight you provided me.

 

That said, I must reiterate that Power Cloner has indeed been a successful solution to my problem, minus the CPU performance of it. Speaking of, the performance is not that bad, but regardless, the sole reason I made this post was to find a faster alternative.

 

I've just created and rendered a little "making of" to demonstrate how Power Cloner works for me. You can see how the "non lit" (obscure) part of my character is unaffected, which is the desired outcome.

 

Video: https://streamable.com/xbig40

 

Please tell me what you make of it. Much appreciated!

Link to comment
3 hours ago, noseman said:

Soooooo... I went down a rabbit hole with this.

Check out this video and if this is the effect you want, I have a solution.

Youtube tutorial and scene file coming Monday.

 

https://www.dropbox.com/s/wxrv0epg5c9o9qr/Ray_Casting_Clones_Nodes.mp4?dl=0

 

Well darn it, @noseman. You are too kind.

 

It's funny, because I've been tinkering for at least 2 weeks trying to find a solution to this problem, and based on your recent Youtube tutorials (voxel-related ones specifically, which I've watched dozens of times), I recall a handful of times thinking "I feel like noseman would get a kick out of solving this problem". For all I know, you might have solved it in 2 seconds, so I feel a little validated in knowing that it also took you some considerable R&D on your part to find a solution, especially one that's plugin-free.

 

Thanks again a million times. Very much looking forward to seeing your approach.

 

Have a wonderful week-end!

Link to comment
  • Customer

Noseman's approach resembles a planar ray collision like as in area light ray-casting.

 

I though you needed something more narrow like a laser-stripe. 

image.png.0282ed560a57f77c38cabf7c6fe11e56.png

 


My suggestion to Maxon involved something like this:

Spoiler

It's a scene with rocks and tree logs. The node produces a point cloud were rays from a light-source hit the scene. Looks much like what Noseman did with his test video.
 

image.png.28160e7ae493508532e6c8ed0c08445a.png


There's a Ray Collision node (both in XPresso and Scene Nodes) that might help you. But I'm not sure about the discreet nature of it (voxel like distribution of clones) and discreetness in space (original surface polygon space). 

 

image.png.ba0f290dba0479b8e2c6e50d21fecd31.png

 

I'm very eager to see how Noseman tackled this.

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • LATEST ACTIVITIES

    1. 220

      Scene Nodes | Capsules file pit

    2. 3

      Flipped clones in multi-segments curve

    3. 2

      How to create continuous UV texture for irregular wall like shapes ?

    4. 52

      Looking forward to the next C4D release

    5. 3

      3DTOOLS.INFO | SUMMER Special - 30% OFF!

×
×
  • Create New...

Copyright Core 4D © 2023 Powered by Invision Community