Le 18/06/2013 14:07, Pierrick Koch a écrit :
>
> In src/morse/builder/actuators.py:
>
> > +        self.light = Spot("LightSpot")
> > +        self.append(self.light)
> > +        self.properties(Emit=True)
> > +
> > +    def properties(self, **kwargs):
> > +        ActuatorCreator.properties(self, **kwargs)
> > +        if (self.light):
> > +            spot = self.light._bpy_object.data
> > +            if (spot.type == 'SPOT'):
> > +                if "size" in kwargs.keys():
> > +                    spot.spot_size = kwargs['size']
> > +                if "distance" in kwargs.keys():
> > +                    spot.distance = kwargs['distance']
> > +                if "color" in kwargs.keys():
> > +                    import re
> > +                    spot.color = tuple(int(v) for v in re.findall("[0-9]+", kwargs['color']))
>
> why a regular expression here, can't you pass an RGB tuple directly?
>
> light.properties(  color=(101,  255,  199)  )

because the properties function (called via 
ActuatorCreator.properties()) only accepts GameProperty types 
(http://www.blender.org/documentation/blender_python_api_2_61_0/bpy.types.GameProperty.html?highlight=property#bpy.types.GameProperty)

> —
> Reply to this email directly or view it on GitHub 
> <https://github.com/morse-simulator/morse/pull/406/files#r4745894>.
>