PDA

View Full Version : PROBLEM w/custom attribute


ReneAlex
02-25-2004, 04:59 PM
I just apply the technique mencioned in the 3dsmax character riging tutorial about the CA for the stretchy spine... all went fine until today i open the scene and a warning appears telling me about a this...

>> MAXScript Script Controller Exception: -- Unknown property: "stretchable" in PEN_Attribute_Holder 2:PEN_Attribute_Holder 2 <<

is strange because i dont change the name of any ofthe objs related w/ the script and i just must to click "evaluate" and close 5 times (for each spine bone) and then all works perfect.

is very annoying, is there a workaround... or any kind of explanation???

thks

LFShade
02-25-2004, 07:38 PM
Either you have not created a "stretchable" CA on the attribute holder (maybe you named it something different?), or the script controllers are being evaluated before the modifier and its attributes are loaded. If the former is the case, then just change the script controllers' .stretchable reference to whatever you named the CA. If it is the latter, then you need to add an if..do clause to the script controllers to test for the presence of the .stretchable property. You can look up hasProperty and isProperty in the Maxscript docs for an idea of how to accomplish this.


RH

ReneAlex
02-25-2004, 10:59 PM
well...

I think that the if..do solution is the way because, i triple check the syntax and there is not errors in the objs names...

I'm not sure how i ll do what you recommned... but surely it must be less complicated that it sounds ...

I understand now that the problem is that the script loads itself before the CA, and it "think" that something is missing... so what i ll try to do is tell the script that it must look for the obj BEFORE process the rest... right?

SILLY EXAMPLE:

look for the CA "stretchable" in obj X
if CA is present do the rest

dependsOn $_RIG_CRJ_ikSPLINE_spline $_RIG_CRJ_CRTLspineARR;

origLen = 173.327; -- Put your orig length here
origBone = 32.3032; -- Put your orig bone/script value here

pct = $_RIG_CRJ_CRTLspineARR.PEN_Attribute_Holder_2.stretchable;
newLen = curveLength $_RIG_CRJ_ikSPLINE_spline;

xPos =(origBone*(1.0-(pct/100.0))) + (origBone*newLen/origLen*(pct/100.0));

---------

now i must read the manual to figure out how to tell maxscript to do so...

OK!

THks!

:wip:

ReneAlex
02-26-2004, 06:07 PM
I just realize that i dont need to use a float to control the amount of stretch... just... that part of the rig ..(not the spine) i dont need to keep control of it.

so i put this:

pct = 100

so ... the CA is just not necessary...

pct = $_RIG_CRJ_CRTLspineARR.PEN_Attribute_Holder_2.stretchable;

...

by the way the spine that has the same script never "complain"...

is a very dumb thing that the software dont realize that the CA is present, I mean if in frist place its works why the file dont "remenber" that conection... puff! ... tech junk.

PEN
03-03-2004, 06:13 PM
Looks like you are using my tutorial so I guess I should jump in.

Sounds to be like an object that has been renamed. this also might be caused by not having PEN Attribute Holder loaded in the stdScripts folder and it isn't loading befor the script controller is making it's first call to it.

ReneAlex
03-03-2004, 06:44 PM
hey ... well yes I read and use your tutorial, and some others, so like many out there, I prepare my "combo" to suit my needs...

your script, is installed and working perfectly, in fact all the CA wired in my rig are controlled by a PEN CA Holder. (I prefer your CA holder)

but in the spine is the one w/the problem, I find a older file and start over the rig from the hip up, so i dont have the pop up dialog problem anymore. but Im afraid that in a future its forgets again to load the CA holder first.

its seems like the script loads first like LFShade says. but iam not skilled enough to find the solution that he propose.

NOW:

I have your script in the startup folder in script, maybe THATS the problem, I ll move it to stdScripts and find that scene w/problems, to find out.

THANKS!!!!

:wip:

CGTalk Moderation
01-17-2006, 01:00 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.