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
   
 
AttributeError: Parameter Access Failed [Python]
Posted: 20 May 2015 06:21 PM   [ Ignore ]  
Avatar
Total Posts:  93
Joined  2013-09-19

My console is giving me this error:

Traceback (most recent call last):
  File “‘Python’”, line 5, in main
AttributeError: parameter access failed

My script is as follows

import c4d


def main():
  wtag = op[c4d.ID_USERDATA,1]
  obj = wtag.GetObject()
  pts = ob.GetAllPoints()
  print len (pts)
     
  pass

line 5 = wtag = op[c4d.ID_USERDATA,1]

I am following along in a video tutorial for which I have verified everything I have written. I can’t for the life of me figure out why I am getting this error.

Profile
 
 
Posted: 20 May 2015 07:43 PM   [ Ignore ]   [ # 1 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

Hi CreativeRaul,

This would be placed into the Cineversity video tutorial thread. I can’t remember, though, having seen this here. Would you mind to name the tutorial title so I can move the thread? Thanks.
Seams like the User Data is not a fit to the Python call. Is it 1?
All the best

File Attachments
CV2_r16_drs_15_PYud_01.c4d.zip  (File Size: 31KB - Downloads: 309)
 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: 20 May 2015 08:22 PM   [ Ignore ]   [ # 2 ]  
Avatar
Total Posts:  93
Joined  2013-09-19

Dr. Sassi,

Sadly it is an outside tutorial from http://c4dapt.com. The tutorial is on building a python script to animate weight maps. Its narrated by Simon Holmedal.

The syntax his using seems to be shorthand but it compiles for him in the video but not for me. I am just starting learning Python in C4D so I can’t figure out why its not working.

I have been reviewing the material at http://www.cineversity.com/wiki/Python:_Generator/  for some clubs as to why it is not working.

Profile
 
 
Posted: 20 May 2015 09:02 PM   [ Ignore ]   [ # 3 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

Hi CreativeRaul,

No wonder I couldn’t “place it” anywhere here at Cineversity.

>ob vs obj< ?

Sorry, I have no access to the material itself nor interest in spending $79 (Don’t get me wrong, I would love to see it). One of the members of the group created a FXPHD.com course for Python, perhaps that might be of value to you: C4D208.

How about writing to the author? They certainly should have a natural interest in customer satisfaction, right?

Sometimes it helps to “google” parts of the script, to find a forum/blog that has already discussed that part/problem.

Perhaps place a request for tutorials into the specific forum section. As Python was developed to teach kids “coding”, my impression is, it is not Python that causes the trouble in the first place. Talking with all kind of people, it is the SDK and debugging part, that keeps people out. A solid SDK introduction with all formats and how to find the right content, as well a detailed debugging strategy discussion is needed. Simple island solutions with no option to “extrapolate” or to develop further are not really what I would like to see.

Good luck.

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: 23 May 2015 05:59 PM   [ Ignore ]   [ # 4 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

P.S.: not that I like to guess here, especially not for a tutorial that I have never seen, nor any idea about its target.

Could that be the way he suggested it:

def main():
  wtag = op[c4d.ID_USERDATA,1]
  obj = op.GetObject()
  pts = obj.GetAllPoints()
  print len (pts)

I have extended it—see image or check the one minute movie
https://www.amazon.com/clouddrive/share/t7E1VBg7sgKn2A3lWAL7DGeDYswATiSWBwTCL-WBtcM?ref_=cd_share_link_copy

My best wishes to get this cleared with the author, and for understanding that we certainly try to help, but I guess to do now the support for other products that companies sells… I hope I could clear a little bit here.

 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: 23 May 2015 09:08 PM   [ Ignore ]   [ # 5 ]  
Avatar
Total Posts:  93
Joined  2013-09-19

Dr. Sassi

Thank you for continuing to trouble shoot the issue. I had guidance from a colleague who suggested to check the placement of the USERDATA. Which I did and realized it was placed on the null and not the Python tag. Once I corrected this mistake the script worked correctly.

- R

Profile
 
 
Posted: 23 May 2015 10:27 PM   [ Ignore ]   [ # 6 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

Hi CreativeRaul,

Thanks for the feedback. Nice that this is solved.

In the screenshot above (post #4), I have both UserData options integrated (object as well as tag), once you got the “obj” (which can be named differently, the key is that you point “python” into the right direction what is in the variable) then you can request data from it.

I hope the little movie clip illustrates the User Data ID as well a little bit. Both have an ID 1, but based on where “python” is looking for it counts here.

It is not my main place, and I knew nearly nothing from the scene-file nor the tutorial. I updated a little bit my post above to keep it clear.
Anyway, I’m glad you know someone who can support you with that series.

Have a great weekend

 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: 24 May 2015 02:06 AM   [ Ignore ]   [ # 7 ]  
Avatar
Total Posts:  93
Joined  2013-09-19

Yes the video is very helpful in clarifying the targeting of the USERDATA. Thank you for the video.

And have a great weekend also.

Profile
 
 
Posted: 24 May 2015 01:24 PM   [ Ignore ]   [ # 8 ]  
Administrator
Avatar
Total Posts:  12043
Joined  2011-03-04

You’re welcome, CreativeRaul. Thank you!

 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