Change falloff shape in a plain effector

On 28/04/2013 at 11:26, xxxxxxxx wrote:

Hi everyone

I am new in Phyton and I'm trying to change Falloff shape from infinity to linear in a plain effector but get the following error.

AttributeError: parameter set failed

When I change the weight slider it works fine

What am I missing?
Here is the code.

  
def main() :  
   
  plain = c4d.BaseObject(1018643)  
  doc.InsertObject(plain)  
  plain[c4d.FALLOFF_STRENGTH] = 0 #<<<< this works fine  
  plain[c4d.FALLOFF_MODE] = 2   
    
if __name__=='__main__':  
  main()  

On 28/04/2013 at 11:50, xxxxxxxx wrote:

each falloff type is a separate plugin/class. you have to pass the proper id.

from ofalloff_panel.h

#ifndef _Ofalloff_panel_H_
#define _Ofalloff_panel_H_
  
enum
{
	//Falloff mode ID's
	FALLOFF_MODE_INFINITE		= 1019543,
	FALLOFF_MODE_BOX				= 1019544,
	FALLOFF_MODE_SPHERE			= 1019545,
	FALLOFF_MODE_CYLINDER		= 1019546,
	FALLOFF_MODE_LINEAR			= 1019547,
	FALLOFF_MODE_SPLINE			= 1019548,
	FALLOFF_MODE_CONE			= 1019549,
	FALLOFF_MODE_TORUS			= 1019550,
  
	//Falloff controls
	FALLOFF_GROUPFALLOFF		= 5100,
	FALLOFF_MODE						=	5105,
	FALLOFF_INVERT					=	5113,
	FALLOFF_VISIBLE					=	5115
};
#endif

so it would be plain[c4d.FALLOFF_MODE] = c4d.FALLOFF_MODE_SPHERE or something like
that.

On 28/04/2013 at 12:39, xxxxxxxx wrote:

Thank you very much!