A new version of Cineversity has been launched. This legacy site and its tutorials will remain accessible for a limited transition period

Visit the New Cineversity
   
 
set value to 1 and stay
Posted: 15 December 2014 12:35 PM   [ Ignore ]  
Avatar
Total Posts:  44
Joined  2007-01-15

Hello all
i’m trying to do a simple xpresso script that will set value 1 to a collision between 2 object, the collision node work fine for that but the next step I want to include is to ” once the value as been set to 1 then stay at this “1” value.
any help will be graetly appreciated

Thx. Gregg
I also include the file, the vibrate node is only for animation

File Attachments
switch materials.c4d.zip  (File Size: 63KB - Downloads: 181)
Profile
 
 
Posted: 15 December 2014 02:47 PM   [ Ignore ]   [ # 1 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

HI Gregg,

The typical set up would be done with a FlipFlop. It allows to have an on “trigger” and an separate off “trigger”.

I have reset it on frame zero, just to be on the safe side. ;o)

As usual I have on the left side what feeds the set up.
In the middle the “calculate/compute” field.
On the right side the results.

You will find three steps:
• get a result from the collision,
• then feed the FlipFlop,
• and finally the material “switch” (Condition>Attribute Manger>Data Type: Material)

I sorted the X-Manager as well, and set the XPresso tag to camera dependent, for direct refresh.

I hope that will work for you.

All the best

Sassi

File Attachments
CV2_r16_drs_14_XPff_01.c4d.zip  (File Size: 53KB - Downloads: 149)
 Signature 

Dr. Sassi V. Sassmannshausen Ph.D.
Cinema 4D Mentor since 2004
Maxon Master Trainer, VES, DCS

Photography For C4D Artists: 200 Free Tutorials.
https://www.youtube.com/user/DrSassiLA/playlists

NEW:

NEW: Cineversity [CV4]

Profile
 
 
Posted: 15 December 2014 04:59 PM   [ Ignore ]   [ # 2 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

P.S.: just of the fun of it. I was curious about a sequence. Each time the object is hit, the next material should be used. Here is the result. (Works with all material placed into the list, nearly infinite…

File Attachments
CV2_r16_drs_14_XPff_03.c4d.zip  (File Size: 152KB - Downloads: 176)
 Signature 

Dr. Sassi V. Sassmannshausen Ph.D.
Cinema 4D Mentor since 2004
Maxon Master Trainer, VES, DCS

Photography For C4D Artists: 200 Free Tutorials.
https://www.youtube.com/user/DrSassiLA/playlists

NEW:

NEW: Cineversity [CV4]

Profile
 
 
Posted: 15 December 2014 05:29 PM   [ Ignore ]   [ # 3 ]  
Avatar
Total Posts:  44
Joined  2007-01-15

Thanks you so much (again) I was wondering this process can be done for a group of object let say multiples cubes ? all manage by only one collider object ( let say the sphere in this case) ?
I can easy read from a iteartion tag for the object but how do I resend the info in the material tag at the end of the chain ??

Thx

Profile
 
 
Posted: 15 December 2014 05:39 PM   [ Ignore ]   [ # 4 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

You’re welcome, Gregg.

Please specify here, you want that each cube changes individually the material based on a “personal” contact? …or all cubes changes instantly the material if only one got hit by the sphere?

I would think that at one point, it might be easier to set up an XPresso tag (Tag Preset) that can be attached to single objects, and have an input field for the “collider”.

It might be also interesting to check if the XPresso/Dynamic—Ghost options might not work more appropriate here.

All the best

Sassi

 Signature 

Dr. Sassi V. Sassmannshausen Ph.D.
Cinema 4D Mentor since 2004
Maxon Master Trainer, VES, DCS

Photography For C4D Artists: 200 Free Tutorials.
https://www.youtube.com/user/DrSassiLA/playlists

NEW:

NEW: Cineversity [CV4]

Profile
 
 
Posted: 15 December 2014 05:50 PM   [ Ignore ]   [ # 5 ]  
Avatar
Total Posts:  44
Joined  2007-01-15

Yes I was wondering to have individual object to change color bas on personal contact, on the object B, Never think about this Ghost option I will have to take a look at this ! as well what do you mean about the expresso tag / preset !!?

Thanks

Profile
 
 
Posted: 15 December 2014 06:00 PM   [ Ignore ]   [ # 6 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

Perhaps you check this first :o)

I will answer anything else after lunch.

File Attachments
CV2_r16_drs_14_MGsc_01.c4d.zip  (File Size: 42KB - Downloads: 135)
 Signature 

Dr. Sassi V. Sassmannshausen Ph.D.
Cinema 4D Mentor since 2004
Maxon Master Trainer, VES, DCS

Photography For C4D Artists: 200 Free Tutorials.
https://www.youtube.com/user/DrSassiLA/playlists

NEW:

NEW: Cineversity [CV4]

Profile
 
 
Posted: 15 December 2014 06:34 PM   [ Ignore ]   [ # 7 ]  
Avatar
Total Posts:  44
Joined  2007-01-15

hooooo this is very nice will it work also with a more complexe shader ? like a link to a shader ?

Profile
 
 
Posted: 15 December 2014 07:14 PM   [ Ignore ]   [ # 8 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

To answer the questions above (post #5) first:

The Ghost allows for a similar setting as the collision. You can place that information then into the MoGraph Selection Tag. It might need to be set similar to what I have done with the FlipFlop, to keep the values once they changed. I have attached a scene file from the previous Forum (2010) but updated it so it works in r16. In the moment the sphere hits the glass, it switches to a different object.

The Preset Tag. Typically you can set up a connection to an object, so the object with the tag is always used. Then have a link field in the User Data. If all XPresso tags are selected (Selection Object for re-selections!), all similar values can be filled at once, e.g., the Sphere. See image. (Object Manager>File>Save/load Tag Preset)

Post #7

The idea is here to use a) the color directly if that fit the bill OR b) use the Shader Effector (set the Fracture color for the clones to black) and use the MoGraph Color Shader then as Layer mask in the Layer shader inside of a material, or as Alpha to construct something with many materials in the Object manager. (Sorry if I’m simplify here, but the options are too large to list them all.) I guess you get the idea, or ask, I’m happy to detail more based on more input.

The Tracer allows as well to set the length of the resulting spline (time wise) and so to reset the values. To use the Tracer as Source in the Falloff is optional in all Effectors.

All the best
Sassi

File Attachments
CV2_r16_drs_14_DYth_01.c4d.zip  (File Size: 426KB - Downloads: 163)
 Signature 

Dr. Sassi V. Sassmannshausen Ph.D.
Cinema 4D Mentor since 2004
Maxon Master Trainer, VES, DCS

Photography For C4D Artists: 200 Free Tutorials.
https://www.youtube.com/user/DrSassiLA/playlists

NEW:

NEW: Cineversity [CV4]

Profile
 
 
Posted: 16 December 2014 02:24 AM   [ Ignore ]   [ # 9 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

Hi Gregg,

Finally I got this working. Thehehe. Took me while. But I found a little “hack” to get this: I used the Texture Tag name as value storage—and some other stuff.

The amount of collision objects is not limited. I have set up the system here with eight, but increase the two link lists as well the iteration and more objects should be no problem.

In the moment a “cube” got hit by the “sphere”, the material changes and stays in that way.

The idea is pretty simple (after all the trial and error). At the first frame all texture tags (not materials!) are renamed to “0”.
If a collision happen, during that frame the texture tag is renamed in “1”.
If the texture tag has a name “1” it disables any influence to be renamed back to “0”. *

(* It is an old trick that I have learned while I got an education at my electrician-school-time (… one of my six degrees, sorry for bragging, but I give credit here to my old teachers. So it’s something I have learned way back in time, while my main target was to be a gaffer at a TV station with 16.)

Have a great evening

Sassi

P.S.: let it play and have a look at the link list view in the Attribute Manager. Just for fun!

File Attachments
CV2_r16_drs_14_XPic_01.c4d.zip  (File Size: 58KB - Downloads: 181)
 Signature 

Dr. Sassi V. Sassmannshausen Ph.D.
Cinema 4D Mentor since 2004
Maxon Master Trainer, VES, DCS

Photography For C4D Artists: 200 Free Tutorials.
https://www.youtube.com/user/DrSassiLA/playlists

NEW:

NEW: Cineversity [CV4]

Profile
 
 
Posted: 16 December 2014 12:07 PM   [ Ignore ]   [ # 10 ]  
Avatar
Total Posts:  44
Joined  2007-01-15

Hooooo this is exactly what i’m was after I will try to use this as a base and use some hiearchy nodes to mange the objects, I think it might not work with the texture, what do you think?
, I don’t know waht the result might be !we will see

Profile
 
 
Posted: 16 December 2014 03:26 PM   [ Ignore ]   [ # 11 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

You’re welcome, Gregg.

”…, what do you think?”

Well, obviously I like Link-Lists. :o) Over the past decade+ one of my observation is, that there are two kinds of artists in this regard, one who loves Link Lists more and others who prefer Hierarchy options. (Perhaps a small third group is there, who decides case based, which might be preferable ;o)
Certainly each option has its advantage.

As I never suggest Hierarchy nodes here in the forum, let me give you my perspective about. As long as you are the only artist working on such, and you have a standard set up (or something that helps you in an easy way perhaps a year later to know what you did), they are great and fast. However, as they are not dynamically, in terms of any changes in the Object Manager, adding elements or moving them, they are dangerous on the long run and in teams. Hierarchy Nodes are limited to a repeatable Iteration Path. Which makes them easier to understand after a while how they are “programmed”, but what is effected might be more cumbersome. Relatively easy to set up for large hierarchies, but also more limited. In any way, once they are set up, again, any change in the Hierarchy will disable the intended function. Yes, how to access a specific Texture Tag with this one in sync… I don’t even know how to get the Tag Iteration into sync. (In my file above, I have no problems with such in the Link Lists…)

Link Lists are easy to set up with the little “selection tool” since a while, and what ever happens to the organization in the object manager, they are pretty stable against such changes. To check two or more parallel lists against each other, if they are in sync, seems so much easier. There is my point why I use these and don’t encourage anything else.

Both have not feedback to the Object Manager, which is a big problem to know what is done.

Again, it is an artist call, and what ever works for an artist is the thing one should use, if the functionality allows a comparison at all in the first place.

My best wishes for your implementation.

Sassi

 Signature 

Dr. Sassi V. Sassmannshausen Ph.D.
Cinema 4D Mentor since 2004
Maxon Master Trainer, VES, DCS

Photography For C4D Artists: 200 Free Tutorials.
https://www.youtube.com/user/DrSassiLA/playlists

NEW:

NEW: Cineversity [CV4]

Profile