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
   
 
Interaction tag , joints animation and reset PSR
Posted: 16 November 2016 07:38 AM   [ Ignore ]  
Total Posts:  13
Joined  2011-12-27

Hello everyone,
I’m experimenting with the interaction tag in r16
using it to drive joint rotations.

Interaction tag works fine with pose morphs but how about using to drive joints?

A) How do I set auto key to work with interaction tag without having to select the joint?
B) How to reset PSR on the joint directly from the interaction tag, without having to select for the joint?
C) How to activate the interaction tag’s polygons through a subdivision cage?
I’ve seen this done in demo’s bu they don’t describe the set-up… :/

Any ideas?

Thanks!
Leo of Sweden

File Attachments
interaction_tag_joint_ctrl.c4d.zip  (File Size: 111KB - Downloads: 112)
Profile
 
 
Posted: 16 November 2016 06:12 PM   [ Ignore ]   [ # 1 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

Hi Leo of Sweden,

Yes, the information, especially when it comes to scripting is very small.

There are two entries in the library:
Introduction
https://www.cineversity.com/vidplaytut/new_in_cinema_4d_r16_interaction_tag
Example files available: FILES Button.
Example
https://www.cineversity.com/vidplaytut/ibc_2014_rewind_lars
Starting at 17:10 (23:10)

BTW: Rick Barrett has also created Zero-Out scripts and tutorials for C.O.F.F.E.E. Python here on Cineversity.
as well…
http://www.cineversity.com/wiki/Category:Scripting/plugincafe.com

Please note that there are example files in the Help Content, you can recognize those as the look like a file icon of C4D.

a) the Auto-key for specific objects needs a “Selection Object” containing the objects in question. Was that a question with the Interaction Tag, perhaps someone with Scripting knowledge can share an idea.

With the objects active: [R16] Selection> Selection Filter> Create Selection Object.
You can drag or delete from this list.Name the list wisely. Where the three red key buttons are, the one with the ? contains the names of the created Selection Objects.

b) It could be done with the HIT information and a Switch Node. The Global Matrix of the Object is connected to Input 1 and Input 2 is set to 0;0;0;1;0;0;0;1;0;0;0;1.When it hits, the Matrix is set to zero.
Perhaps you like local instead of Global.  Perhaps switching the XPresso on off might work.

Or in the Python section: [compile]
def onSelect():
  #Code for what happens when the object gets selected goes here
  c4d.CallCommand(1019940)

You might also try
c4d.CallCommand(600000333)

c) no idea.

I will check other options, and add them to this post if so. Edit: see P.S. below /edit

All the best

 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: 17 November 2016 09:22 PM   [ Ignore ]   [ # 2 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

P.S.:

Note that I’m not a “coder”. This is an example of how I would do it.

The Reset PSR could be also seen as taken the Matrix from an object that is on “PSR zero with the scale to one”; Or in Matrix numbers—
“off: 0,0,0 v1: 1,0,0 v2: 0,1, 0 v3: 0,0,1”.

To make that more visible, I took the Global Matrix from the Cylinder. It will showcase the “zero”. (Yes, it is not actually zero in values in this example)
The reset in the example is given in this scene by placing the Disc on the Global Matrix of the Cylinder. I called all variables “varT” or so, and “zero”. These are not Python specifics.

The Torus is the object with the Interactive tag. If the Torus is high-lighted, the code is active.

To re-use the code I saved it as script and in this way it is available in the Commands. With a code that will be different on another machine, based on the individual “ID” I guess. So, for the example/demo, I’m just fine with that. It works also directly in the code, what out for the indentation-rule!
As mentioned above, a script should contain a fail-safe routine, if the searched content is not available, and perhaps a undo option.

The one minute clip, which might look better if downloaded. It is in UHD of course.
https://www.amazon.com/clouddrive/share/GRSGmOgy6Iz97eFMeGDljgPQZbnNrgS2jFnsEEdXTID?ref_=cd_ph_share_link_copy

As I mentioned, I’m not a coder, so if you like to get up to speed and the tutorials aren’t enough. In a full script the undo options should be included, and an option that uses an alternative information if an object is not found. Again, just an example! Perhaps consider a 1on1 session with someone who is fluent in code. ENJOY.
...............

import c4d
from c4d import gui
#Welcome to the world of Python

def main():
  varG = doc.SearchObject(‘Cylinder’)
  varT = doc.SearchObject(‘Disc’)
  varM = varG.GetMg()
  zero = varM
  varT.SetMg(zero)
  c4d.EventAdd()
     
if __name__==‘__main__’:
  main()

For my example I have used a very simple and visual demo, and I’m aware (as mentioned hopefully enough times) that this is perhaps something for a real coder heart.

To dive deeper into this, please have a look here:
https://developers.maxon.net/docs/Cinema4DPythonSDK/html/modules/c4d/Matrix/index.html?highlight=relative matrix
You might notice that the Local Matrix might have to acknowledge the Freeze as well.
Since I’m not really clear, nor coder, I guess I have to leave it here.

So, I hope I could point into the right direction, and showed what is needed as well to have it safer.

ENJOY

P.S.2: I couldn’t leave it that way, here is one with “Undo” (from Rick Barrett’s tut) and a little line if the object is not found.
Use with caution ;o) If the Disc is named differently the alert will show. Entry in script and object name must be the same. Works with one object, so keep the name unique.
Screeen-shot:
https://www.amazon.com/clouddrive/share/1bEiad5sHXxNNM4021VsPdo4YPPD7w63DOO3GKsXalM?ref_=cd_ph_share_link_copy
Scene File Sketch:
[global]
https://www.amazon.com/clouddrive/share/FXeHavEhRH1rlbjb66xy7WAwa7uAFzemMTDhCRc3h65?ref_=cd_ph_share_link_copy
[local]
https://www.amazon.com/clouddrive/share/FkBSt5IZoFVUKdYzEsy3ayMMYuUH1b9mopgAx7GJJO6?ref_=cd_ph_share_link_copy
If I’m not mistaken SetMg() for global and SetMl() for local Matrix

 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: 18 November 2016 06:08 AM   [ Ignore ]   [ # 3 ]  
Total Posts:  13
Joined  2011-12-27

Thank you so much Dr Sassi!
I’ll give this a go.
It would so cool if I can get this to work.

I really appreciate you taking the time and effort
to look into this and for being such a vital part of the c4d
community over the years.

I will be sure to share my discoveries and solutions with everyone,
reporting back on the development, even if it might take some time
as I’m in production and learning rigging on my spare time.

All my best and thank you so much once again!

Profile
 
 
Posted: 18 November 2016 07:42 AM   [ Ignore ]   [ # 4 ]  
Total Posts:  13
Joined  2011-12-27

Hi again,
Regarding c)  animating through a SDS cage on the interaction tag.

Here’s the demo I was referring to:
https://www.cineversity.com/vidplaylist/cv-interactive_morph_tag/cv-morph_interaction_tag_part_02

Notice that the head geo is selected in the object manager and
that the SDS is on as he moves the mesh in the viewport…

I wonder what that set-up is like?

smile

Leo

Profile
 
 
Posted: 18 November 2016 04:45 PM   [ Ignore ]   [ # 5 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

You’re very welcome, Leo.

Very nice of you.

The only way it might work, at least in the scenes I have tested* (e.g., the two from the help content), with the new SDS [R18] or with the older HyperNURBS [R16], is when the settings are in the way as in the screenshot.

Disable Transformation – checked on.
Example (But object needs to be selected, or do I miss here anything?)
https://www.amazon.com/clouddrive/share/qumJnjjHnV93jDdOWFDHIOtqWFjl1HE3ry0DBZM22Uc?ref_=cd_ph_share_link_copy

https://www.amazon.com/clouddrive/share/IbRXUcF9tvmanKYDv1MRE1Ue8lvmzMFzO7X9BioV6Nz?ref_=cd_ph_share_link_copy

Since your original post requested no selection –  just do it, I avoided everything that needs additional clicking, e.g., to go to the Interactive Tag and set things so one can work again.

But if that works for you, perhaps here you have the solution ;o)

Besides that: I have no idea.

All the best

*Help content scenes:
https://help.maxon.net/#TINTERACTION
There are two c4d file icons. In the Help Content of you C4D Help (not the online version) you can double click on those. You might know that already, but I write here in a forum, some might not notice it so far.

 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: 18 November 2016 08:42 PM   [ Ignore ]   [ # 6 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

P.S.: the question of how to record Key Frames for objects not being active.
Perhaps have a look here

BaseDocument.RecordKey

https://developers.maxon.net/docs/Cinema4DPythonSDK/html/search.html?q=BaseDocument.RecordKey&check_keywords=yes&area=default

I have no idea about this, but I might experiment over the weekend with it.

Screenshot, just in case things change in the link above
https://www.amazon.com/clouddrive/share/kL80iVhYpJPVsBLwcIpPsNzrTCHIiPn2BQqwAs1MSnK?ref_=cd_ph_share_link_copy

Of course, perhaps the approach needs to be adapted to your target, so the Joints are not the one receiving the key, perhaps a Null object as Active dynamic Proxy can be recorded and directs the joints, as target or IK.

For some more information—please have a look here: (As any not active Object, AFAIK, needs to have a very precise description of what, when and where to write the keyframe., Not a simple task. The Cineversity Wiki entry shows some example.)

https://www.cineversity.com/wiki/Python:_DescIDs_and_Animation/

 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: 27 November 2016 09:28 AM   [ Ignore ]   [ # 7 ]  
Total Posts:  13
Joined  2011-12-27

Hi Dr Sassi,
Here is a solution to
A) autokeying from the interaction tag to the joint.

In the interaction tag insert the joint as the dynamic proxy for the polygon selection map.
Now autokeying seems to see the joint.

Does this work for you too Dr Sassi?
Leo

PS Press play to see the animation.

File Attachments
c01 interaction tag test 03 arm swing.c4d.zip  (File Size: 126KB - Downloads: 117)
Profile
 
 
Posted: 27 November 2016 04:01 PM   [ Ignore ]   [ # 8 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

Hi Leo,

Yes, if you move them with the Proxy-Option, that will set Key Frames, but there is obviously no change in the PoseMorph anymore. Wasn’t that the original question?
The function of the PoseMorph seems very little, as one can see while being in Gouraud Shading Line mode.

But perhaps the interaction is the key here and not the PoseMorph.

My best wishes

 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: 27 November 2016 04:21 PM   [ Ignore ]   [ # 9 ]  
Total Posts:  13
Joined  2011-12-27

That is right Dr Sassi, I’m working on multiple solutions at once.
The original here problem was that it wasn’t to autokey through the interaction tag to the joint.
Thereby your solution above to use selection objects, which was one why to solve it.
Another is by using the joint (or joint’s control null) as a proxy.

The pose morph is a second layer to fire correct shape sculpts with set driver/set driven.
But first I wanted to be able to autokey just by animating through the interaction tag.
If that makes any sense at all smile
Leo

Profile
 
 
Posted: 27 November 2016 04:31 PM   [ Ignore ]   [ # 10 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

My best wishes for your exploration, Leo.

It certainly makes sense to explore and follow one’s target. Even things might not always work, there is no failure: only added experience! :o)

A Proxy based move and at the same time a (Joint) Pose Morph might end in a conflict.

Personally, I rarely use auto-key. Well, if you like it – perfect – but set auto-save to on, so you never overwrite something that worked already beautifully!

All the best

 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