[Bf-python] problem with the new modifier module and scon + msvc 7.0

jmsoler at free.fr jmsoler at free.fr
Sun Apr 23 11:34:48 CEST 2006


Selon jean-michel soler <jmsoler at free.fr>:

> It seems that it does not compile :
>
> Compiling ==> 'Modifier.c'
> Modifier.c
> source\blender\python\api2_2x\Modifier.c(271) : warning C4047: 'return'
> : 'int' differs in levels of indirection from 'PyObject *'
> source\blender\python\api2_2x\Modifier.c(1105) : warning C4047:
> 'initializing' : 'unsigned char *' differs in levels of indirection from
> 'getter'
> source\blender\python\api2_2x\Modifier.c(1106) : error C2078: too many
> initializers
> scons: ***
> [E:\bf-blender\build\win32-vc\source\blender\python\api2_2x\Modifier.
> obj] Error 2
> scons: building terminated because of errors.


from Blender import *

 ob = Object.Get('Cube')        # retrieve an object
 mods = ob.modifiers            # get the object's modifiers
 for mod in mods:
   print mod,mod.name           # print each modifier and its name
   mod = mods.append(mod.SUBSURF) # add a new subsurf modifier
 mod[mod.keys().LEVELS] = 3     # set subsurf subdivision levels to 3

Should be :

-----> mod = mods.append(mods.SUBSURF) # add a new subsurf modifier <-----






More information about the Bf-python mailing list