svn merge -r 16593:16648 https://svn.blender.org/svnroot/bf-blender/trunk/blender
authorDaniel Genrich <daniel.genrich@gmx.net>
Sun, 21 Sep 2008 13:03:39 +0000 (13:03 +0000)
committerDaniel Genrich <daniel.genrich@gmx.net>
Sun, 21 Sep 2008 13:03:39 +0000 (13:03 +0000)
170 files changed:
SConstruct
extern/bullet2/src/BulletCollision/BroadphaseCollision/btDbvtBroadphase.cpp
extern/bullet2/src/BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.cpp
extern/bullet2/src/BulletCollision/CollisionShapes/btConvexHullShape.cpp
extern/bullet2/src/BulletCollision/CollisionShapes/btConvexHullShape.h
extern/bullet2/src/BulletCollision/CollisionShapes/btConvexInternalShape.cpp
extern/bullet2/src/BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.cpp
intern/SoundSystem/SConscript
intern/SoundSystem/sdl/SND_SDLCDDevice.cpp
release/plugins/sequence/dnr.c
release/scripts/animation_bake_constraints.py
release/scripts/console.py
source/blender/blenkernel/BKE_bad_level_calls.h
source/blender/blenkernel/BKE_blender.h
source/blender/blenkernel/BKE_property.h
source/blender/blenkernel/BKE_utildefines.h
source/blender/blenkernel/SConscript
source/blender/blenkernel/bad_level_call_stubs/stubs.c
source/blender/blenkernel/intern/action.c
source/blender/blenkernel/intern/brush.c
source/blender/blenkernel/intern/colortools.c
source/blender/blenkernel/intern/constraint.c
source/blender/blenkernel/intern/curve.c
source/blender/blenkernel/intern/depsgraph.c
source/blender/blenkernel/intern/displist.c
source/blender/blenkernel/intern/particle_system.c
source/blender/blenkernel/intern/property.c
source/blender/blenkernel/intern/scene.c
source/blender/blenlib/BLI_arithb.h
source/blender/blenlib/BLI_blenlib.h
source/blender/blenlib/intern/arithb.c
source/blender/blenlib/intern/dynlib.c
source/blender/blenlib/intern/edgehash.c
source/blender/blenlib/intern/freetypefont.c
source/blender/blenlib/intern/util.c
source/blender/blenloader/intern/readfile.c
source/blender/gpu/GPU_extensions.h
source/blender/gpu/intern/gpu_codegen.c
source/blender/gpu/intern/gpu_extensions.c
source/blender/imbuf/intern/divers.c
source/blender/imbuf/intern/rectop.c
source/blender/include/BIF_editseq.h
source/blender/include/BIF_outliner.h
source/blender/include/blendef.h
source/blender/makesdna/DNA_curve_types.h
source/blender/makesdna/DNA_ipo_types.h
source/blender/makesdna/DNA_lamp_types.h
source/blender/makesdna/DNA_scene_types.h
source/blender/makesdna/DNA_space_types.h
source/blender/python/BPY_extern.h
source/blender/python/BPY_interface.c
source/blender/python/api2_2x/Camera.c
source/blender/python/api2_2x/Ipocurve.h
source/blender/python/api2_2x/Lamp.c
source/blender/python/api2_2x/Material.c
source/blender/python/api2_2x/Object.c
source/blender/python/api2_2x/Pose.c
source/blender/python/api2_2x/Scene.c
source/blender/python/api2_2x/Text.c
source/blender/python/api2_2x/World.c
source/blender/python/api2_2x/doc/API_intro.py
source/blender/python/api2_2x/doc/API_related.py
source/blender/python/api2_2x/doc/Blender.py
source/blender/python/api2_2x/doc/Object.py
source/blender/python/api2_2x/sceneRender.c
source/blender/render/extern/include/RE_pipeline.h
source/blender/render/intern/include/render_types.h
source/blender/render/intern/include/texture.h
source/blender/render/intern/source/convertblender.c
source/blender/render/intern/source/pipeline.c
source/blender/render/intern/source/pixelshading.c
source/blender/render/intern/source/rendercore.c
source/blender/render/intern/source/shadeoutput.c
source/blender/render/intern/source/texture.c
source/blender/src/SConscript
source/blender/src/buttons_logic.c
source/blender/src/buttons_scene.c
source/blender/src/buttons_shading.c
source/blender/src/drawipo.c
source/blender/src/drawmesh.c
source/blender/src/drawobject.c
source/blender/src/drawview.c
source/blender/src/editaction.c
source/blender/src/editcurve.c
source/blender/src/editipo.c
source/blender/src/editipo_mods.c
source/blender/src/editmesh_loop.c
source/blender/src/editobject.c
source/blender/src/editseq.c
source/blender/src/glutil.c
source/blender/src/header_oops.c
source/blender/src/header_view3d.c
source/blender/src/outliner.c
source/blender/src/renderwin.c
source/blender/src/retopo.c
source/blender/src/seqaudio.c
source/blender/src/seqscopes.c
source/blender/src/space.c
source/blender/src/toolbox.c
source/blender/src/transform.c
source/blender/src/transform_conversions.c
source/blender/src/writeimage.c
source/blender/yafray/intern/export_File.cpp
source/blender/yafray/intern/export_Plugin.cpp
source/creator/creator.c
source/gameengine/Converter/BL_ActionActuator.cpp
source/gameengine/Converter/BL_BlenderDataConversion.cpp
source/gameengine/Converter/BL_ShapeActionActuator.cpp
source/gameengine/Expressions/PyObjectPlus.h
source/gameengine/GameLogic/Joystick/SCA_Joystick.cpp
source/gameengine/GameLogic/Joystick/SCA_Joystick.h
source/gameengine/GameLogic/Joystick/SCA_JoystickEvents.cpp
source/gameengine/GameLogic/Joystick/SCA_JoystickPrivate.h
source/gameengine/GameLogic/SCA_ActuatorSensor.cpp
source/gameengine/GameLogic/SCA_DelaySensor.cpp
source/gameengine/GameLogic/SCA_ISensor.cpp
source/gameengine/GameLogic/SCA_JoystickManager.cpp
source/gameengine/GameLogic/SCA_JoystickSensor.cpp
source/gameengine/GameLogic/SCA_KeyboardSensor.cpp
source/gameengine/GameLogic/SCA_MouseSensor.cpp
source/gameengine/GameLogic/SCA_PropertyActuator.cpp
source/gameengine/GameLogic/SCA_PropertySensor.cpp
source/gameengine/GameLogic/SCA_PythonController.cpp
source/gameengine/GameLogic/SCA_PythonController.h
source/gameengine/GameLogic/SCA_RandomActuator.cpp
source/gameengine/GameLogic/SCA_RandomSensor.cpp
source/gameengine/GameLogic/SConscript
source/gameengine/GamePlayer/common/GPC_RawImage.cpp
source/gameengine/GamePlayer/common/GPC_RawImage.h
source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
source/gameengine/Ketsji/BL_Shader.cpp
source/gameengine/Ketsji/BL_Shader.h
source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.cpp
source/gameengine/Ketsji/KX_CameraActuator.cpp
source/gameengine/Ketsji/KX_ConstraintActuator.cpp
source/gameengine/Ketsji/KX_ConstraintActuator.h
source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp
source/gameengine/Ketsji/KX_GameActuator.cpp
source/gameengine/Ketsji/KX_GameObject.cpp
source/gameengine/Ketsji/KX_IpoActuator.cpp
source/gameengine/Ketsji/KX_MouseFocusSensor.cpp
source/gameengine/Ketsji/KX_ParentActuator.cpp
source/gameengine/Ketsji/KX_RadarSensor.cpp
source/gameengine/Ketsji/KX_RaySensor.cpp
source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp
source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp
source/gameengine/Ketsji/KX_Scene.cpp
source/gameengine/Ketsji/KX_SceneActuator.cpp
source/gameengine/Ketsji/KX_StateActuator.cpp
source/gameengine/Ketsji/KX_TouchSensor.cpp
source/gameengine/Ketsji/KX_TrackToActuator.cpp
source/gameengine/Ketsji/KX_VisibilityActuator.cpp
source/gameengine/Physics/BlOde/OdePhysicsEnvironment.cpp
source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
source/gameengine/Physics/Bullet/CcdPhysicsController.h
source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp
source/gameengine/Rasterizer/RAS_2DFilterManager.cpp
source/gameengine/Rasterizer/RAS_2DFilterManager.h
source/gameengine/Rasterizer/RAS_OpenGLFilters/RAS_Blur2DFilter.h
source/gameengine/Rasterizer/RAS_OpenGLFilters/RAS_Dilation2DFilter.h
source/gameengine/Rasterizer/RAS_OpenGLFilters/RAS_Erosion2DFilter.h
source/gameengine/Rasterizer/RAS_OpenGLFilters/RAS_GrayScale2DFilter.h
source/gameengine/Rasterizer/RAS_OpenGLFilters/RAS_Invert2DFilter.h
source/gameengine/Rasterizer/RAS_OpenGLFilters/RAS_Laplacian2DFilter.h
source/gameengine/Rasterizer/RAS_OpenGLFilters/RAS_Prewitt2DFilter.h
source/gameengine/Rasterizer/RAS_OpenGLFilters/RAS_Sepia2DFilter.h
source/gameengine/Rasterizer/RAS_OpenGLFilters/RAS_Sharpen2DFilter.h
source/gameengine/Rasterizer/RAS_OpenGLFilters/RAS_Sobel2DFilter.h
tools/Blender.py
tools/btools.py

index 356f116e29030bbcc8d4bc1d3193fd2a32ae63a2..0a959cc5b7bb4de8314376b55f0a148baf58c182 100644 (file)
@@ -267,6 +267,18 @@ if 'blenderlite' in B.targets:
     env['WITH_BF_YAFRAY'] = False
     env['WITH_BF_REDCODE'] = False
     env['WITH_BF_FTGL'] = False
+    env['WITH_BF_DDS'] = False
+    env['WITH_BF_ZLIB'] = False
+    env['WITH_BF_SDL'] = False
+    env['WITH_BF_JPEG'] = False
+    env['WITH_BF_PNG'] = False
+    env['WITH_BF_ODE'] = False
+    env['WITH_BF_BULLET'] = False
+    env['WITH_BF_BINRELOC'] = False
+    env['BF_BUILDINFO'] = False
+    env['BF_NO_ELBEEM'] = True
+    
+
 
 # lastly we check for root_build_dir ( we should not do before, otherwise we might do wrong builddir
 #B.root_build_dir = B.arguments.get('BF_BUILDDIR', '..'+os.sep+'build'+os.sep+platform+os.sep)
@@ -410,6 +422,26 @@ if  env['OURPLATFORM']!='darwin':
             source=[dp+os.sep+f for f in df]
             scriptinstall.append(env.Install(dir=dir,source=source))
 
+#-- icons
+if env['OURPLATFORM']=='linux2':
+       iconlist = []
+       icontargetlist = []
+
+       for tp, tn, tf in os.walk('release/freedesktop/icons'):
+               if 'CVS' in tn:
+                       tn.remove('CVS')
+               if '.svn' in tn:
+                       tn.remove('.svn')
+               for f in tf:
+                       print ">>>", env['BF_INSTALLDIR'], tp, f
+                       iconlist.append(tp+os.sep+f)
+                       icontargetlist.append(env['BF_INSTALLDIR']+tp[19:]+os.sep+f)
+
+       iconinstall = []
+       for targetdir,srcfile in zip(icontargetlist, iconlist):
+               td, tf = os.path.split(targetdir)
+               iconinstall.append(env.Install(dir=td, source=srcfile))
+
 #-- plugins
 pluglist = []
 plugtargetlist = []
@@ -458,6 +490,8 @@ textinstall = env.Install(dir=env['BF_INSTALLDIR'], source=textlist)
 
 if  env['OURPLATFORM']=='darwin':
         allinstall = [blenderinstall, plugininstall, textinstall]
+elif env['OURPLATFORM']=='linux2':
+        allinstall = [blenderinstall, dotblenderinstall, scriptinstall, plugininstall, textinstall, iconinstall]
 else:
         allinstall = [blenderinstall, dotblenderinstall, scriptinstall, plugininstall, textinstall]
 
index fd82fd7cae3cbd87d560ee28480cb7f1462c0943..e711078f4e2ddde56c29eaa3371d9104f5247dee 100644 (file)
@@ -119,7 +119,7 @@ void        Process(const btDbvtNode* n)
 //
 btDbvtBroadphase::btDbvtBroadphase(btOverlappingPairCache* paircache)
 {
-m_deferedcollide       =       false;
+m_deferedcollide       =       true;//false;
 m_needcleanup          =       true;
 m_releasepaircache     =       (paircache!=0)?false:true;
 m_prediction           =       1/(btScalar)2;
index c9256473c00ce956c7c3617b16798d1dd95e6dd9..c2b13f5903ff7334cdc3f682e21218059ee22778 100644 (file)
@@ -56,11 +56,16 @@ void btSphereSphereCollisionAlgorithm::processCollision (btCollisionObject* col0
        btScalar radius0 = sphere0->getRadius();
        btScalar radius1 = sphere1->getRadius();
 
-       //m_manifoldPtr->clearManifold(); //don't do this, it disables warmstarting
+#ifdef CLEAR_MANIFOLD
+       m_manifoldPtr->clearManifold(); //don't do this, it disables warmstarting
+#endif
 
        ///iff distance positive, don't generate a new contact
        if ( len > (radius0+radius1))
        {
+#ifndef CLEAR_MANIFOLD
+               resultOut->refreshContactPoints();
+#endif //CLEAR_MANIFOLD
                return;
        }
        ///distance (negative means penetration)
@@ -82,7 +87,9 @@ void btSphereSphereCollisionAlgorithm::processCollision (btCollisionObject* col0
        
        resultOut->addContactPoint(normalOnSurfaceB,pos1,dist);
 
-       //no resultOut->refreshContactPoints(); needed, because of clearManifold (all points are new)
+#ifndef CLEAR_MANIFOLD
+       resultOut->refreshContactPoints();
+#endif //CLEAR_MANIFOLD
 
 }
 
index deb3954b5c351a59fb515749fe5468e2de79eb0c..2596858bc3a05e06c66630434005f0473e1be335 100644 (file)
@@ -36,6 +36,13 @@ btConvexHullShape ::btConvexHullShape (const btScalar* points,int numPoints,int
 }
 
 
+
+void btConvexHullShape::setLocalScaling(const btVector3& scaling)
+{
+       m_localScaling = scaling;
+       recalcLocalAabb();
+}
+
 void btConvexHullShape::addPoint(const btPoint3& point)
 {
        m_points.push_back(point);
index c029ca19403aec1b7e5a6e94dc945d705ec5b439..4773de2dc513ad8a045ccfd3b3b9756ecb885113 100644 (file)
@@ -71,7 +71,8 @@ public:
        virtual void getPlane(btVector3& planeNormal,btPoint3& planeSupport,int i ) const;
        virtual bool isInside(const btPoint3& pt,btScalar tolerance) const;
 
-
+       ///in case we receive negative scaling
+       virtual void    setLocalScaling(const btVector3& scaling);
 
 };
 
index f828d28e18c876c6b29b215e2fccfbe77c9b78e1..fb81c8a5bde7b46104c198771f7ffa0219a840a4 100644 (file)
@@ -26,7 +26,7 @@ m_collisionMargin(CONVEX_DISTANCE_MARGIN)
 
 void   btConvexInternalShape::setLocalScaling(const btVector3& scaling)
 {
-       m_localScaling = scaling;
+       m_localScaling = scaling.absolute();
 }
 
 
index 5a17b4e2df016b7091e41121a855c54c5861e28e..845a5e3005d031ba621077b47c9c7eef79717a9b 100644 (file)
@@ -56,8 +56,18 @@ void btScaledBvhTriangleMeshShape::processAllTriangles(btTriangleCallback* callb
        btScaledTriangleCallback scaledCallback(callback,m_localScaling);
        
        btVector3 invLocalScaling(1.f/m_localScaling.getX(),1.f/m_localScaling.getY(),1.f/m_localScaling.getZ());
-       btVector3 scaledAabbMin = aabbMin * invLocalScaling;
-       btVector3 scaledAabbMax = aabbMax * invLocalScaling;
+       btVector3 scaledAabbMin,scaledAabbMax;
+
+       ///support negative scaling
+       scaledAabbMin[0] = m_localScaling.getX() >= 0. ? aabbMin[0] * invLocalScaling[0] : aabbMax[0] * invLocalScaling[0];
+       scaledAabbMin[1] = m_localScaling.getY() >= 0. ? aabbMin[1] * invLocalScaling[1] : aabbMax[1] * invLocalScaling[1];
+       scaledAabbMin[2] = m_localScaling.getZ() >= 0. ? aabbMin[2] * invLocalScaling[2] : aabbMax[2] * invLocalScaling[2];
+       
+       scaledAabbMax[0] = m_localScaling.getX() <= 0. ? aabbMin[0] * invLocalScaling[0] : aabbMax[0] * invLocalScaling[0];
+       scaledAabbMax[1] = m_localScaling.getY() <= 0. ? aabbMin[1] * invLocalScaling[1] : aabbMax[1] * invLocalScaling[1];
+       scaledAabbMax[2] = m_localScaling.getZ() <= 0. ? aabbMin[2] * invLocalScaling[2] : aabbMax[2] * invLocalScaling[2];
+       
+       
        m_bvhTriMeshShape->processAllTriangles(&scaledCallback,scaledAabbMin,scaledAabbMax);
 }
 
@@ -66,8 +76,16 @@ void btScaledBvhTriangleMeshShape::getAabb(const btTransform& trans,btVector3& a
 {
        btVector3 localAabbMin = m_bvhTriMeshShape->getLocalAabbMin();
        btVector3 localAabbMax = m_bvhTriMeshShape->getLocalAabbMax();
-       localAabbMin *= m_localScaling;
-       localAabbMax *= m_localScaling;
+
+       btVector3 tmpLocalAabbMin = localAabbMin * m_localScaling;
+       btVector3 tmpLocalAabbMax = localAabbMax * m_localScaling;
+
+       localAabbMin[0] = (m_localScaling.getX() >= 0.) ? tmpLocalAabbMin[0] : tmpLocalAabbMax[0];
+       localAabbMin[1] = (m_localScaling.getY() >= 0.) ? tmpLocalAabbMin[1] : tmpLocalAabbMax[1];
+       localAabbMin[2] = (m_localScaling.getZ() >= 0.) ? tmpLocalAabbMin[2] : tmpLocalAabbMax[2];
+       localAabbMax[0] = (m_localScaling.getX() <= 0.) ? tmpLocalAabbMin[0] : tmpLocalAabbMax[0];
+       localAabbMax[1] = (m_localScaling.getY() <= 0.) ? tmpLocalAabbMin[1] : tmpLocalAabbMax[1];
+       localAabbMax[2] = (m_localScaling.getZ() <= 0.) ? tmpLocalAabbMin[2] : tmpLocalAabbMax[2];
 
        btVector3 localHalfExtents = btScalar(0.5)*(localAabbMax-localAabbMin);
        btScalar margin = m_bvhTriMeshShape->getMargin();
index baf680f03f0df7926a164aeb1816834ee018c2c7..be19c4b791535fb3f07125075dca1f30baa94570 100644 (file)
@@ -14,4 +14,7 @@ if env['WITH_BF_OPENAL']:
 else:
        defs = 'NO_SOUND'
 
+if not env['WITH_BF_SDL']:
+       defs += ' DISABLE_SDL'
+
 env.BlenderLib ('bf_soundsystem', sources, Split(incs), Split(defs), libtype=['core','player'], priority = [20,140] )
index 8bb6c642b114e0cd82f9f14e721b89f9cd110c37..0ab0fa94c7b74a4d06ecd10e7ede0bf924926d52 100644 (file)
@@ -55,6 +55,10 @@ SND_SDLCDDevice::SND_SDLCDDevice() :
 
 void SND_SDLCDDevice::init()
 {
+#ifdef DISABLE_SDL
+       fprintf(stderr, "Blender compiled without SDL, no CDROM support\n");
+       return;
+#else
        if (SDL_InitSubSystem(SDL_INIT_CDROM))
        {
                fprintf(stderr, "Error initializing CDROM\n");
@@ -75,19 +79,23 @@ void SND_SDLCDDevice::init()
        /* Did if open? Check if cdrom is NULL */
        if(!m_cdrom)
        {
-               fprintf(stderr, "Couldn't open drive: %s", SDL_GetError());
+               fprintf(stderr, "Couldn't open drive: %s\n", SDL_GetError());
                return;
        }
+#endif
 }
 
 SND_SDLCDDevice::~SND_SDLCDDevice()
 {
+#ifndef DISABLE_SDL
        StopCD();
        SDL_CDClose(m_cdrom);
+#endif
 }
 
 void SND_SDLCDDevice::NextFrame()
 {
+#ifndef DISABLE_SDL
        m_frame++;
        m_frame &= 127;
        
@@ -111,20 +119,24 @@ void SND_SDLCDDevice::NextFrame()
                }
        
        }
+#endif
 }
        
 void SND_SDLCDDevice::PlayCD(int track)
 {
+#ifndef DISABLE_SDL
        if ( m_cdrom && CD_INDRIVE(SDL_CDStatus(m_cdrom)) ) {
                SDL_CDPlayTracks(m_cdrom, track-1, 0, track, 0);
                m_cdplaying = true;
                m_cdtrack = track;
        }
+#endif
 }
 
 
 void SND_SDLCDDevice::PauseCD(bool pause)
 {
+#ifndef DISABLE_SDL
        if (!m_cdrom)
                return;
                
@@ -132,13 +144,16 @@ void SND_SDLCDDevice::PauseCD(bool pause)
                SDL_CDPause(m_cdrom);
        else
                SDL_CDResume(m_cdrom);
+#endif
 }
 
 void SND_SDLCDDevice::StopCD()
 {
+#ifndef DISABLE_SDL
        if (m_cdrom)
                SDL_CDStop(m_cdrom);
        m_cdplaying = false;
+#endif
 }
 
 void SND_SDLCDDevice::SetCDPlaymode(int playmode)
index 7e7c168750e2cfa9eb4f02db09946105f920c064..b6a99de0622fc315e5d6874984f22b1d5c7707b2 100644 (file)
@@ -110,9 +110,9 @@ static void doit(unsigned char * src_, unsigned char * dst_,
        unsigned char * dst = dst_;
 
        while (count--) {
-               *dst++ = table[(*src++ << 8) | *dst];
-               *dst++ = table[(*src++ << 8) | *dst];
-               *dst++ = table[(*src++ << 8) | *dst];
+               *dst = table[(*src++ << 8) | *dst]; dst++;
+               *dst = table[(*src++ << 8) | *dst]; dst++;
+               *dst = table[(*src++ << 8) | *dst]; dst++;
                *dst++ = *src++;
        }
 
index 8a416c3c488112e9552453aa420da03edc55068a..58e9e2b1d02b62c8947134627233da14959ab2f8 100644 (file)
@@ -602,7 +602,7 @@ def bakeObject(ob): #bakes the core object locrot and assigns the Ipo to a Clone
        if ob != None:  
                # Clone the object - duplicate it, clean the clone, and create an ipo curve for the clone
                myob = duplicateLinked(ob)  #clone it
-               myob.name= usrObjectNamePrefix + ob.getName()
+               myob.setName(usrObjectNamePrefix + ob.getName())
                removeConstraintsOb(myob)   #my object is a free man
                deLinkOb('Ipo',myob)        #kids, it's not nice to share. you've been lied to
                if ob.getType() != ARMATURE: # baking armatures is based on bones, not object
index 9a18c724d4710ca1bf5f61bbc6ba7d07f619c2a9..0e46f41f581be7cee12bf2a5e6f8d9123c6ec3b5 100644 (file)
@@ -67,6 +67,8 @@ __FONT_SIZE__ = 2 # index for the list above, normal default.
 global __CONSOLE_LINE_OFFSET__
 __CONSOLE_LINE_OFFSET__ = 0
 
+cmdBuffer = [] # dosnt need to be global
+
 '''
 # Generic Blender functions
 def getActScriptWinRect():
@@ -159,19 +161,13 @@ def include(filename):
        return compile(filedata, filename, 'exec')
 
 # Writes command line data to a blender text file.
-def writeCmdData(cmdLineList, type):
-       if type == 3:
-               typeList = [0,1,2, 3, None] # all
-       else:
-               typeList = [type] # so we can use athe lists 'in' methiod
-       
+def writeCmdData(type):
        newText = Text.New('command_output.py', 1)
-       for myCmd in cmdLineList:
-               if myCmd.type in typeList: # user input
-                       newText.write('%s\n' % myCmd.cmd)
+       if type == 3:   newText.write('\n'.join( [ myCmd.cmd for myCmd in cmdBuffer ] ))
+       else:                   newText.write('\n'.join( [ myCmd.cmd for myCmd in cmdBuffer if myCmd.type is type] ))
        Draw.PupMenu('%s written' % newText.name)
 
-def insertCmdData(cmdBuffer):
+def insertCmdData():
        texts = list(bpy.data.texts)
        textNames = [tex.name for tex in texts]
        if textNames:
@@ -337,7 +333,6 @@ def handle_event(evt, val):
        
        # Insert Char into the cammand line
        def insCh(ch): # Instert a char
-               global cmdBuffer
                global cursor
                # Later account for a cursor variable
                cmdBuffer[-1].cmd = ('%s%s%s' % ( cmdBuffer[-1].cmd[:cursor], ch, cmdBuffer[-1].cmd[cursor:]))
@@ -346,7 +341,7 @@ def handle_event(evt, val):
        #                        Define Complex Key Actions                            #
        #------------------------------------------------------------------------------#
        def actionEnterKey():
-               global histIndex, cursor, cmdBuffer
+               global histIndex, cursor
                
                def getIndent(string):
                        # Gather white space to add in the previous line
@@ -412,14 +407,20 @@ def handle_event(evt, val):
                        
                        # Clear the output based on __LINE_HISTORY__
                        if len(cmdBuffer) > __LINE_HISTORY__:
-                               cmdBuffer = cmdBuffer[-__LINE_HISTORY__:]
+                               cmdBuffer[:__LINE_HISTORY__] = []
                
                histIndex = cursor = -1 # Reset cursor and history
        
        def actionUpKey():
-               global histIndex, cmdBuffer
+               global histIndex
                if abs(histIndex)+1 >= len(cmdBuffer):
                        histIndex = -1
+                       
+                       # When wrapping allow 1 plank lines
+                       if cmdBuffer[-1].cmd != ' ':
+                               cmdBuffer[-1].cmd = ' '
+                               return
+               
                histIndex_orig = histIndex
                histIndex -= 1
                
@@ -431,9 +432,15 @@ def handle_event(evt, val):
                        cmdBuffer[-1].cmd = cmdBuffer[histIndex].cmd                    
        
        def actionDownKey():
-               global histIndex, cmdBuffer
+               global histIndex
                if histIndex >= -2:
                        histIndex = -len(cmdBuffer)
+                       
+                       # When wrapping allow 1 plank lines
+                       if cmdBuffer[-1].cmd != ' ':
+                               cmdBuffer[-1].cmd = ' '
+                               return
+                       
                histIndex_orig = histIndex
                histIndex += 1
                while   (cmdBuffer[histIndex].type != 0 and histIndex != -2) or \
@@ -446,18 +453,18 @@ def handle_event(evt, val):
        
        def actionRightMouse():
                global __FONT_SIZE__
-               choice = Draw.PupMenu('Console Menu%t|Write Input Data (white)|Write Output Data (blue)|Write Error Data (red)|Write All Text|%l|Insert Blender text|%l|Font Size|%l|Quit')
+               choice = Draw.PupMenu('Console Menu%t|Write Input Data (white)|Write Output Data (blue)|Write Error Data (red)|Write All Text|%l|Insert Blender text|%l|Font Size|%l|Clear Output|Quit')
                
                if choice == 1:
-                       writeCmdData(cmdBuffer, 0) # type 0 user
+                       writeCmdData(0) # type 0 user
                elif choice == 2:
-                       writeCmdData(cmdBuffer, 1) # type 1 user output
+                       writeCmdData(1) # type 1 user output
                elif choice == 3:
-                       writeCmdData(cmdBuffer, 2) # type 2 errors
+                       writeCmdData(2) # type 2 errors
                elif choice == 4:
-                       writeCmdData(cmdBuffer, 3) # All
+                       writeCmdData(3) # All
                elif choice == 6:
-                       insertCmdData(cmdBuffer) # Insert text from Blender and run it.
+                       insertCmdData() # Insert text from Blender and run it.
                elif choice == 8:
                        # Fontsize.
                        font_choice = Draw.PupMenu('Font Size%t|Large|Normal|Small|Tiny')
@@ -471,8 +478,10 @@ def handle_event(evt, val):
                                elif font_choice == 4:
                                        __FONT_SIZE__ = 0
                                Draw.Redraw()
-                               
-               elif choice == 10: # Exit
+               elif choice == 10: # Clear all output
+                       cmdBuffer[:] = [cmd for cmd in cmdBuffer if cmd.type == 0] # keep user input
+                       Draw.Redraw()
+               elif choice == 11: # Exit
                        Draw.Exit()
        
        
@@ -783,7 +792,6 @@ __CONSOLE_VAR_DICT__ = {} # Initialize var dict
 
 
 # Print Startup lines, add __bpydoc__ to the console startup.
-cmdBuffer = []
 for l in __bpydoc__.split('<br>'):
        cmdBuffer.append( cmdLine(l, 1, None) )
        
@@ -827,12 +835,19 @@ def include_console(includeFile):
 
 def standard_imports():
        # Write local to global __CONSOLE_VAR_DICT__ for reuse,
+       
+       exec('%s%s' % ('__CONSOLE_VAR_DICT__["bpy"]=', 'bpy'))
+       exec('%s%s' % ('__CONSOLE_VAR_DICT__["Blender"]=', 'Blender'))
+       
        for ls in (dir(), dir(Blender)):
                for __TMP_VAR_NAME__ in ls:
                        # Execute the local > global coversion.
                        exec('%s%s' % ('__CONSOLE_VAR_DICT__[__TMP_VAR_NAME__]=', __TMP_VAR_NAME__))
        
-       exec('%s%s' % ('__CONSOLE_VAR_DICT__["bpy"]=', 'bpy'))
+       # Add dummy imports to input so output scripts to a text file work as expected
+       cmdBuffer.append(cmdLine('import bpy', 0, 1))
+       cmdBuffer.append(cmdLine('import Blender', 0, 1)) # pretend we have been executed, as we kindof have.
+       cmdBuffer.append(cmdLine('from Blender import *', 0, 1))
 
 if scriptDir and console_autoexec:
        include_console(console_autoexec) # pass the blender module
index 8dee9a27f49cba1ea1ed4cabaa9b680efd4453d8..0b623526562aae11bc5fe3e772aae55bd404072b 100644 (file)
@@ -141,7 +141,7 @@ short pupmenu(char *instr);  // will be general callback
 /* scene.c */
 #include "DNA_sequence_types.h"
 void free_editing(struct Editing *ed); // scenes and sequences problem...
-void BPY_do_all_scripts (short int event);
+void BPY_do_all_scripts (short int event, short int anim);
 int BPY_call_importloader(char *name);
 
 
index 0591937ea4cfa50e0b792f381877b7b6dea36b30..8dbb90372f0478e7d3b7cae4727ad6aadaadf247 100644 (file)
@@ -41,7 +41,7 @@ struct ListBase;
 struct MemFile;
 
 #define BLENDER_VERSION                        247
-#define BLENDER_SUBVERSION             2
+#define BLENDER_SUBVERSION             4
 
 #define BLENDER_MINVERSION             245
 #define BLENDER_MINSUBVERSION  15
index f1587790c4ad9741a88e4586da5fd8c5445f4e21..6af1deda72705d49359b719b76eab0912b24348c 100644 (file)
@@ -41,7 +41,8 @@ struct bProperty *copy_property(struct bProperty *prop);
 void copy_properties(struct ListBase *lbn, struct ListBase *lbo);
 void init_property(struct bProperty *prop);
 struct bProperty *new_property(int type);
-struct bProperty *get_property(struct Object *ob, char *name);
+struct bProperty *get_ob_property(struct Object *ob, char *name);
+void set_ob_property(struct Object *ob, struct bProperty *propc);
 int compare_property(struct bProperty *prop, char *str);
 void set_property(struct bProperty *prop, char *str);
 void add_property(struct bProperty *prop, char *str);
index d647a74c6e282f7b943c2f8cd98e990387b9a8fc..9662d6fbff86fa0de638490feaf750ce45209ee5 100644 (file)
 
 #define AVG2(x, y)             ( 0.5 * ((x) + (y)) )
 
+#define FTOCHAR(val) (val<=0.0f)? 0 : ((val>(1.0f-0.5f/255.0f))? 255 : (char)((255.0f*val)+0.5f))
+
 #define VECCOPY(v1,v2)          {*(v1)= *(v2); *(v1+1)= *(v2+1); *(v1+2)= *(v2+2);}
 #define VECCOPY2D(v1,v2)          {*(v1)= *(v2); *(v1+1)= *(v2+1);}
 #define QUATCOPY(v1,v2)         {*(v1)= *(v2); *(v1+1)= *(v2+1); *(v1+2)= *(v2+2); *(v1+3)= *(v2+3);}
index db67251f44efa9073478c33da20ad4251048d6ab..f891b307b2ccb0991b821701097b30349640f9d3 100644 (file)
@@ -43,7 +43,8 @@ if env['WITH_BF_QUICKTIME'] == 1:
     defs += ' WITH_QUICKTIME'
     incs += ' ' + env['BF_QUICKTIME_INC']
 
-defs += ' WITH_CCGSUBSURF'
+if env['BF_NO_ELBEEM'] == 1:
+    defs += ' DISABLE_ELBEEM'
 
 if env['WITH_BF_PLAYER']:
     SConscript(['bad_level_call_stubs/SConscript'])
index f4beca262d7a97d4c8b389fb7b75fc32ba5c81c3..ae336d0fc26f5f4237b3f45b65e504c193c674aa 100644 (file)
@@ -201,7 +201,7 @@ short pupmenu(char *instr){ return 0;}  // will be general callback
 /* scene.c */
 #include "DNA_sequence_types.h"
 void free_editing(struct Editing *ed){}        // scenes and sequences problem...
-void BPY_do_all_scripts (short int event){}
+void BPY_do_all_scripts (short int event, short int anim){}
 
 /*editmesh_lib.c*/
 void EM_select_face(struct EditFace *efa, int sel) {}
index d65a99f23f087874c0574a1bc04a8e26893ea687..e0afdec5e23c26135fb41398f2be8e7e850acae5 100644 (file)
@@ -1048,7 +1048,7 @@ static float nla_time(float cfra, float unit)
 static float stridechannel_frame(Object *ob, float sizecorr, bActionStrip *strip, Path *path, float pathdist, float *stride_offset)
 {
        bAction *act= strip->act;
-       char *name= strip->stridechannel;
+       const char *name= strip->stridechannel;
        bActionChannel *achan= get_action_channel(act, name);
        int stride_axis= strip->stride_axis;
 
index 6ea470a2263d803932ce34ed288a0941304ee904..1c53af97dbb86a2f52eb0e54170463a53f89a9fa 100644 (file)
@@ -359,7 +359,6 @@ void brush_sample_tex(Brush *brush, float *xy, float *rgba)
                rgba[0]= rgba[1]= rgba[2]= rgba[3]= 1.0f;
 }
 
-#define FTOCHAR(val) val<=0.0f?0: (val>=1.0f?255: (char)(255.0f*val))
 
 void brush_imbuf_new(Brush *brush, short flt, short texfall, int size, ImBuf **outbuf)
 {
index 45b8bb7935cbbf32a5b11da0d7cf98a699cc64de..1bc34aea9a135896dab31ad276db682ba8a10372 100644 (file)
@@ -650,7 +650,6 @@ void curvemapping_evaluate_premulRGBF(CurveMapping *cumap, float *vecout, const
        vecout[2]= curvemap_evaluateF(cumap->cm+2, fac);
 }
 
-#define FTOCHAR(val) val<=0.0f?0: (val>=1.0f?255: (char)(255.0f*val))
 
 void curvemapping_do_ibuf(CurveMapping *cumap, ImBuf *ibuf)
 {
index efb03b71438fd7982a1667a15501eafbf27ffa23..99cf58e8e5a4dbb4a87b4785adc440c358eedb88 100644 (file)
@@ -1872,7 +1872,7 @@ static void pycon_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstraintT
 {
        bPythonConstraint *data= con->data;
        
-       if ((G.f & G_DOSCRIPTLINKS) && VALID_CONS_TARGET(ct)) {
+       if (VALID_CONS_TARGET(ct)) {
                /* special exception for curves - depsgraph issues */
                if (ct->tar->type == OB_CURVE) {
                        Curve *cu= ct->tar->data;
@@ -1886,7 +1886,10 @@ static void pycon_get_tarmat (bConstraint *con, bConstraintOb *cob, bConstraintT
                 * this matrix if it needs to do so
                 */
                constraint_target_to_mat4(ct->tar, ct->subtarget, ct->matrix, CONSTRAINT_SPACE_WORLD, ct->space, con->headtail);
-               BPY_pyconstraint_target(data, ct);
+               
+               /* only execute target calculation if allowed */
+               if (G.f & G_DOSCRIPTLINKS)
+                       BPY_pyconstraint_target(data, ct);
        }
        else if (ct)
                Mat4One(ct->matrix);
@@ -1896,6 +1899,7 @@ static void pycon_evaluate (bConstraint *con, bConstraintOb *cob, ListBase *targ
 {
        bPythonConstraint *data= con->data;
        
+       /* only evaluate in python if we're allowed to do so */
        if ((G.f & G_DOSCRIPTLINKS)==0)  return;
        
 /* currently removed, until I this can be re-implemented for multiple targets */
index 396bdda9c10528b7013b1b9a16aadcab9c1b1b7c..c5ad9e58a4c309fb13bf2b3ea7a0306e1ae66eb5 100644 (file)
@@ -1519,7 +1519,7 @@ void makeBevelList(Object *ob)
                                        bevp->y= bp->vec[1];
                                        bevp->z= bp->vec[2];
                                        bevp->alfa= bp->alfa;
-                                       bevp->f1= 1;
+                                       bevp->f1= SELECT;
                                        bevp++;
                                        bp++;
                                }
@@ -1579,11 +1579,11 @@ void makeBevelList(Object *ob)
                                                
                                                /* indicate with handlecodes double points */
                                                if(prevbezt->h1==prevbezt->h2) {
-                                                       if(prevbezt->h1==0 || prevbezt->h1==HD_VECT) bevp->f1= 1;
+                                                       if(prevbezt->h1==0 || prevbezt->h1==HD_VECT) bevp->f1= SELECT;
                                                }
                                                else {
-                                                       if(prevbezt->h1==0 || prevbezt->h1==HD_VECT) bevp->f1= 1;
-                                                       else if(prevbezt->h2==0 || prevbezt->h2==HD_VECT) bevp->f1= 1;
+                                                       if(prevbezt->h1==0 || prevbezt->h1==HD_VECT) bevp->f1= SELECT;
+                                                       else if(prevbezt->h2==0 || prevbezt->h2==HD_VECT) bevp->f1= SELECT;
                                                }
                                                
                                                v1= data;
@@ -2385,9 +2385,9 @@ void sethandlesNurb(short code)
                                bezt= nu->bezt;
                                a= nu->pntsu;
                                while(a--) {
-                                       if(bezt->f1 || bezt->f3) {
-                                               if(bezt->f1) bezt->h1= code;
-                                               if(bezt->f3) bezt->h2= code;
+                                       if((bezt->f1 & SELECT) || (bezt->f3 & SELECT)) {
+                                               if(bezt->f1 & SELECT) bezt->h1= code;
+                                               if(bezt->f3 & SELECT) bezt->h2= code;
                                                if(bezt->h1!=bezt->h2) {
                                                        if ELEM(bezt->h1, HD_ALIGN, HD_AUTO) bezt->h1= HD_FREE;
                                                        if ELEM(bezt->h2, HD_ALIGN, HD_AUTO) bezt->h2= HD_FREE;
@@ -2415,8 +2415,8 @@ void sethandlesNurb(short code)
                                        bezt= nu->bezt;
                                        a= nu->pntsu;
                                        while(a--) {
-                                               if(bezt->f1 && bezt->h1) ok= 1;
-                                               if(bezt->f3 && bezt->h2) ok= 1;
+                                               if((bezt->f1 & SELECT) && bezt->h1) ok= 1;
+                                               if((bezt->f3 & SELECT) && bezt->h2) ok= 1;
                                                if(ok) break;
                                                bezt++;
                                        }
@@ -2432,8 +2432,8 @@ void sethandlesNurb(short code)
                                bezt= nu->bezt;
                                a= nu->pntsu;
                                while(a--) {
-                                       if(bezt->f1) bezt->h1= ok;
-                                       if(bezt->f3 ) bezt->h2= ok;
+                                       if(bezt->f1 & SELECT) bezt->h1= ok;
+                                       if(bezt->f3 & SELECT) bezt->h2= ok;
        
                                        bezt++;
                                }
index 96ea4fced9d8d67dbd73c0282d2ce0aef0a4453f..7f4910a976505527ba2830d4b2d1dfa7c4534e1f 100644 (file)
@@ -865,12 +865,12 @@ DagNode * dag_get_sub_node (DagForest *forest,void * fob)
        return node;
 }
 
-void dag_add_relation(DagForest *forest, DagNode *fob1, DagNode *fob2, short rel, char *name) 
+static void dag_add_parent_relation(DagForest *forest, DagNode *fob1, DagNode *fob2, short rel, char *name) 
 {
-       DagAdjList *itA = fob1->child;
+       DagAdjList *itA = fob2->parent;
        
        while (itA) { /* search if relation exist already */
-               if (itA->node == fob2) {
+               if (itA->node == fob1) {
                        itA->type |= rel;
                        itA->count += 1;
                        return;
@@ -879,20 +879,23 @@ void dag_add_relation(DagForest *forest, DagNode *fob1, DagNode *fob2, short rel
        }
        /* create new relation and insert at head. MALLOC alert! */
        itA = MEM_mallocN(sizeof(DagAdjList),"DAG adj list");
-       itA->node = fob2;
+       itA->node = fob1;
        itA->type = rel;
        itA->count = 1;
-       itA->next = fob1->child;
+       itA->next = fob2->parent;
        itA->name = name;
-       fob1->child = itA;
+       fob2->parent = itA;
 }
 
-static void dag_add_parent_relation(DagForest *forest, DagNode *fob1, DagNode *fob2, short rel, char *name) 
+void dag_add_relation(DagForest *forest, DagNode *fob1, DagNode *fob2, short rel, char *name) 
 {
-       DagAdjList *itA = fob2->parent;
+       DagAdjList *itA = fob1->child;
        
+       /* parent relation is for cycle checking */
+       dag_add_parent_relation(forest, fob1, fob2, rel, name);
+
        while (itA) { /* search if relation exist already */
-               if (itA->node == fob1) {
+               if (itA->node == fob2) {
                        itA->type |= rel;
                        itA->count += 1;
                        return;
@@ -901,12 +904,12 @@ static void dag_add_parent_relation(DagForest *forest, DagNode *fob1, DagNode *f
        }
        /* create new relation and insert at head. MALLOC alert! */
        itA = MEM_mallocN(sizeof(DagAdjList),"DAG adj list");
-       itA->node = fob1;
+       itA->node = fob2;
        itA->type = rel;
        itA->count = 1;
-       itA->next = fob2->parent;
+       itA->next = fob1->child;
        itA->name = name;
-       fob2->parent = itA;
+       fob1->child = itA;
 }
 
 static char *dag_node_name(DagNode *node)
@@ -966,6 +969,63 @@ static void dag_node_print_dependency_cycle(DagForest *dag, DagNode *startnode,
        printf("\n");
 }
 
+static int dag_node_recurs_level(DagNode *node, int level)
+{
+       DagAdjList *itA;
+       int newlevel;
+
+       node->color= DAG_BLACK; /* done */
+       newlevel= ++level;
+       
+       for(itA= node->parent; itA; itA= itA->next) {
+               if(itA->node->color==DAG_WHITE) {
+                       itA->node->ancestor_count= dag_node_recurs_level(itA->node, level);
+                       newlevel= MAX2(newlevel, level+itA->node->ancestor_count);
+               }
+               else
+                       newlevel= MAX2(newlevel, level+itA->node->ancestor_count);
+       }
+       
+       return newlevel;
+}
+
+static void dag_check_cycle(DagForest *dag)
+{
+       DagNode *node;
+       DagAdjList *itA;
+
+       /* tag nodes unchecked */
+       for(node = dag->DagNode.first; node; node= node->next)
+               node->color= DAG_WHITE;
+       
+       for(node = dag->DagNode.first; node; node= node->next) {
+               if(node->color==DAG_WHITE) {
+                       node->ancestor_count= dag_node_recurs_level(node, 0);
+               }
+       }
+       
+       /* check relations, and print errors */
+       for(node = dag->DagNode.first; node; node= node->next) {
+               for(itA= node->parent; itA; itA= itA->next) {
+                       if(itA->node->ancestor_count > node->ancestor_count) {
+                               if(node->ob && itA->node->ob) {
+                                       printf("Dependency cycle detected:\n");
+                                       dag_node_print_dependency_cycle(dag, itA->node, node, itA->name);
+                               }
+                       }
+               }
+       }
+
+       /* parent relations are only needed for cycle checking, so free now */
+       for(node = dag->DagNode.first; node; node= node->next) {
+               while (node->parent) {
+                       itA = node->parent->next;
+                       MEM_freeN(node->parent);                        
+                       node->parent = itA;
+               }
+       }
+}
+
 /*
  * MainDAG is the DAG of all objects in current scene
  * used only for drawing there is one also in each scene
@@ -1603,6 +1663,8 @@ void DAG_scene_sort(struct Scene *sce)
        
        build_dag(sce, DAG_RL_ALL_BUT_DATA);
        
+       dag_check_cycle(sce->theDag);
+
        nqueue = queue_create(DAGQUEUEALLOC);
        
        for(node = sce->theDag->DagNode.first; node; node= node->next) {
@@ -2206,57 +2268,6 @@ void DAG_object_update_flags(Scene *sce, Object *ob, unsigned int lay)
 
 /* ******************* DAG FOR ARMATURE POSE ***************** */
 
-static int node_recurs_level(DagNode *node, int level)
-{
-       DagAdjList *itA;
-       int newlevel;
-
-       node->color= DAG_BLACK; /* done */
-       newlevel= ++level;
-       
-       for(itA= node->parent; itA; itA= itA->next) {
-               if(itA->node->color==DAG_WHITE) {
-                       itA->node->ancestor_count= node_recurs_level(itA->node, level);
-                       newlevel= MAX2(newlevel, level+itA->node->ancestor_count);
-               }
-               else
-                       newlevel= MAX2(newlevel, level+itA->node->ancestor_count);
-       }
-       
-       return newlevel;
-}
-
-static void pose_check_cycle(DagForest *dag)
-{
-       DagNode *node;
-       DagAdjList *itA;
-
-       /* tag nodes unchecked */
-       for(node = dag->DagNode.first; node; node= node->next)
-               node->color= DAG_WHITE;
-       
-       for(node = dag->DagNode.first; node; node= node->next) {
-               if(node->color==DAG_WHITE) {
-                       node->ancestor_count= node_recurs_level(node, 0);
-               }
-       }
-       
-       /* check relations, and print errors */
-       for(node = dag->DagNode.first; node; node= node->next) {
-               for(itA= node->parent; itA; itA= itA->next) {
-                       if(itA->node->ancestor_count > node->ancestor_count) {
-                               bPoseChannel *pchan= (bPoseChannel *)node->ob;
-                               bPoseChannel *parchan= (bPoseChannel *)itA->node->ob;
-                               
-                               if(pchan && parchan)  {
-                                       printf("Cycle detected:\n");
-                                       dag_node_print_dependency_cycle(dag, itA->node, node, itA->name);
-                               }
-                       }
-               }
-       }
-}
-
 /* we assume its an armature with pose */
 void DAG_pose_sort(Object *ob)
 {
@@ -2286,7 +2297,6 @@ void DAG_pose_sort(Object *ob)
                if(pchan->parent) {
                        node2 = dag_get_node(dag, pchan->parent);
                        dag_add_relation(dag, node2, node, 0, "Parent Relation");
-                       dag_add_parent_relation(dag, node2, node, 0, "Parent Relation");
                        addtoroot = 0;
                }
                for (con = pchan->constraints.first; con; con=con->next) {
@@ -2305,7 +2315,6 @@ void DAG_pose_sort(Object *ob)
                                                if(target) {
                                                        node2 = dag_get_node(dag, target);
                                                        dag_add_relation(dag, node2, node, 0, "Ipo Driver");
-                                                       dag_add_parent_relation(dag, node2, node, 0, "Ipo Driver");
 
                                                        /* uncommented this line, results in dependencies
                                                         * not being added properly for this constraint,
@@ -2325,7 +2334,6 @@ void DAG_pose_sort(Object *ob)
                                                if (target) {
                                                        node2= dag_get_node(dag, target);
                                                        dag_add_relation(dag, node2, node, 0, "IK Constraint");
-                                                       dag_add_parent_relation(dag, node2, node, 0, "IK Constraint");
 
                                                        if (con->type==CONSTRAINT_TYPE_KINEMATIC) {
                                                                bKinematicConstraint *data = (bKinematicConstraint *)con->data;
@@ -2342,7 +2350,6 @@ void DAG_pose_sort(Object *ob)
                                                                while (parchan) {
                                                                        node3= dag_get_node(dag, parchan);
                                                                        dag_add_relation(dag, node2, node3, 0, "IK Constraint");
-                                                                       dag_add_parent_relation(dag, node2, node3, 0, "IK Constraint");
                                                                        
                                                                        segcount++;
                                                                        if (segcount==data->rootbone || segcount>255) break; // 255 is weak
@@ -2359,11 +2366,10 @@ void DAG_pose_sort(Object *ob)
                }
                if (addtoroot == 1 ) {
                        dag_add_relation(dag, rootnode, node, 0, "Root Bone Relation");
-                       dag_add_parent_relation(dag, rootnode, node, 0, "Root Bone Relation");
                }
        }
 
-       pose_check_cycle(dag);
+       dag_check_cycle(dag);
        
        /* now we try to sort... */
        tempbase.first= tempbase.last= NULL;
index 3b79f6689c09dcf4e01cc2a6a95e0eaa98bb27ef..69c8f3406a2fcaf7bf777c99867f8492feb5b118 100644 (file)
@@ -757,7 +757,10 @@ void reshadeall_displist(void)
        
        for(base= G.scene->base.first; base; base= base->next) {
                ob= base->object;
-               freedisplist(&ob->disp);
+
+               if(ELEM5(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_MBALL))
+                       freedisplist(&ob->disp);
+
                if(base->lay & G.scene->lay) {
                        /* Metaballs have standard displist at the Object */
                        if(ob->type==OB_MBALL) shadeDispList(base);
index ee887bee2b1804bc5c392f4a808a28e7f6d55340..7aff0f0eb4954ca1d1a6bf4271120a2f36e03cd5 100644 (file)
@@ -156,7 +156,7 @@ void psys_reset(ParticleSystem *psys, int mode)
                int p=0;
 
                for(; p<psys->totpart; p++, pa++)
-                       pa->flag = PARS_NO_DISP;
+                       pa->flag |= PARS_NO_DISP;
        }
 
        /* reset children */
@@ -2110,22 +2110,18 @@ static void react_to_events(ParticleSystem *psys, int pa_num)
        for(re=psys->reactevents.first; re; re=re->next){
                birth=0;
                if(part->from==PART_FROM_PARTICLE){
-                       if(pa->num==re->pa_num){
+                       if(pa->num==re->pa_num && pa->alive==PARS_UNBORN){
                                if(re->event==PART_EVENT_NEAR){
                                        ParticleData *tpa = re->psys->particles+re->pa_num;
                                        float pa_time=tpa->time + pa->foffset*tpa->lifetime;
-                                       if(re->time > pa_time){
-                                               pa->alive=PARS_ALIVE;
+                                       if(re->time >= pa_time){
                                                pa->time=pa_time;
                                                pa->dietime=pa->time+pa->lifetime;
                                        }
                                }
                                else{
-                                       if(pa->alive==PARS_UNBORN){
-                                               pa->alive=PARS_ALIVE;
-                                               pa->time=re->time;
-                                               pa->dietime=pa->time+pa->lifetime;
-                                       }
+                                       pa->time=re->time;
+                                       pa->dietime=pa->time+pa->lifetime;
                                }
                        }
                }
@@ -2133,7 +2129,6 @@ static void react_to_events(ParticleSystem *psys, int pa_num)
                        dist=VecLenf(pa->state.co, re->state.co);
                        if(dist <= re->size){
                                if(pa->alive==PARS_UNBORN){
-                                       pa->alive=PARS_ALIVE;
                                        pa->time=re->time;
                                        pa->dietime=pa->time+pa->lifetime;
                                        birth=1;
@@ -3127,6 +3122,10 @@ static void deflect_particle(Object *pob, ParticleSystemModifierData *psmd, Part
                        if(through == 0 && (part->flag & PART_DIE_ON_COL || pd->flag & PDEFLE_KILL_PART)) {
                                pa->alive = PARS_DYING;
                                pa->dietime = pa->state.time + (cfra - pa->state.time) * dt;
+                               
+                               /* we have to add this for dying particles too so that reactors work correctly */
+                               VECADDFAC(co, co, col.nor, (through ? -0.0001f : 0.0001f));
+
                                VECCOPY(state->co, co);
                                VecLerpf(state->vel, pa->state.vel, state->vel, dt);
                                QuatInterpol(state->rot, pa->state.rot, state->rot, dt);
@@ -4061,9 +4060,11 @@ static void dynamics_step(Object *ob, ParticleSystem *psys, ParticleSystemModifi
                                pa_dfra = dfra;
                                pa_dtime = dtime;
 
+                               /* we need to calculate this once again because reactions might have changed pa->time */
+                               birthtime = pa->time + pa->loop * pa->lifetime;
                                dietime = birthtime + pa->lifetime;
 
-                               if(birthtime < cfra && birthtime >= psys->cfra){
+                               if(birthtime <= cfra && birthtime >= psys->cfra){
                                        /* particle is born some time between this and last step*/
                                        pa->alive = PARS_ALIVE;
                                        pa_dfra = cfra - birthtime;
@@ -4103,8 +4104,6 @@ static void dynamics_step(Object *ob, ParticleSystem *psys, ParticleSystemModifi
                                                }
                                        }
 
-                                       push_reaction(ob,psys,p,PART_EVENT_NEAR,key);
-
                                        if(pa->alive == PARS_DYING){
                                                push_reaction(ob,psys,p,PART_EVENT_DEATH,key);
 
@@ -4124,6 +4123,8 @@ static void dynamics_step(Object *ob, ParticleSystem *psys, ParticleSystemModifi
                                        }
                                        else
                                                key->time=cfra;
+
+                                       push_reaction(ob,psys,p,PART_EVENT_NEAR,key);
                                }
                        }
                }
index f55bdd152792ade7dd052ee7fdcf74185eabffdb..d2eb058a9a0512a69a23778ba8f1a641e42e79c5 100644 (file)
@@ -83,8 +83,7 @@ bProperty *copy_property(bProperty *prop)
 void copy_properties(ListBase *lbn, ListBase *lbo)
 {
        bProperty *prop, *propn;
-       
-       lbn->first= lbn->last= 0;
+       free_properties( lbn ); /* incase we are copying to an object with props */
        prop= lbo->first;
        while(prop) {
                propn= copy_property(prop);
@@ -139,7 +138,7 @@ bProperty *new_property(int type)
        return prop;
 }
 
-bProperty *get_property(Object *ob, char *name)
+bProperty *get_ob_property(Object *ob, char *name)
 {
        bProperty *prop;
        
@@ -151,6 +150,17 @@ bProperty *get_property(Object *ob, char *name)
        return NULL;
 }
 
+void set_ob_property(Object *ob, bProperty *propc)
+{
+       bProperty *prop;
+       prop= get_ob_property(ob, propc->name);
+       if(prop) {
+               free_property(prop);
+               BLI_remlink(&ob->prop, prop);
+       }
+       BLI_addtail(&ob->prop, copy_property(propc));
+}
+
 /* negative: prop is smaller
  * positive: prop is larger
  */
index 553107dd2648aa782251243f34a72664ebcec1bb..701e8ecb31193143bce01a9413a84f4840a585df 100644 (file)
@@ -350,7 +350,7 @@ void set_scene_bg(Scene *sce)
        /* no full animation update, this to enable render code to work (render code calls own animation updates) */
        
        /* do we need FRAMECHANGED in set_scene? */
-//     if (G.f & G_DOSCRIPTLINKS) BPY_do_all_scripts(SCRIPT_FRAMECHANGED);
+//     if (G.f & G_DOSCRIPTLINKS) BPY_do_all_scripts(SCRIPT_FRAMECHANGED, 0);
 }
 
 /* called from creator.c */
@@ -570,8 +570,8 @@ void scene_update_for_newframe(Scene *sce, unsigned int lay)
        /* object ipos are calculated in where_is_object */
        do_all_data_ipos();
        
-       if (G.f & G_DOSCRIPTLINKS) BPY_do_all_scripts(SCRIPT_FRAMECHANGED);
-       
+       if (G.f & G_DOSCRIPTLINKS) BPY_do_all_scripts(SCRIPT_FRAMECHANGED, 0);
+
        /* sets first, we allow per definition current scene to have dependencies on sets */
        for(sce= sce->set; sce; sce= sce->set)
                scene_update(sce, lay);
index 6e54fae58d0eace41f87af0e4fea48dbbc3a84b8..4b858dcb50304928b48517952b1edf04a0faac5c 100644 (file)
@@ -91,6 +91,7 @@ float saasin(float fac);
 float sasqrt(float fac);
 
 int FloatCompare(float *v1, float *v2, float limit);
+int FloatCompare4(float *v1, float *v2, float limit);
 float FloatLerpf(float target, float origin, float fac);
 
 float CalcNormFloat(float *v1, float *v2, float *v3, float *n);
index a1db7adf33d98e75086b29a8702311e8d63e6eaa..6a50e2de0e5b2076f1c6f1fe742476ac76b5b3e4 100644 (file)
@@ -224,7 +224,7 @@ int BLI_strcaseeq(char *a, char *b);
 
 /* in util.c */
 #ifdef WITH_ICONV
-void BLI_string_to_utf8(char *original, char *utf_8, char *code);
+void BLI_string_to_utf8(char *original, char *utf_8, const char *code);
 #endif
 
        /**
index f89f90f70455f5dccbfd05e56bb825871524f63c..c6634eb77079a65d1b3793433c12a7984795354e 100644 (file)
@@ -1026,6 +1026,19 @@ int FloatCompare( float *v1,  float *v2, float limit)
        return 0;
 }
 
+int FloatCompare4( float *v1,  float *v2, float limit)
+{
+
+       if( fabs(v1[0]-v2[0])<limit ) {
+               if( fabs(v1[1]-v2[1])<limit ) {
+                       if( fabs(v1[2]-v2[2])<limit ) {
+                               if( fabs(v1[3]-v2[3])<limit ) return 1;
+                       }
+               }
+       }
+       return 0;
+}
+
 float FloatLerpf( float target, float origin, float fac)
 {
        return (fac*target) + (1.0f-fac)*origin;
index c4692995f20d4f5151860d6803c2b5216b27ce4c..e7fa3332f435ac27fcc9209fa88bc405101510e8 100644 (file)
@@ -77,12 +77,12 @@ char *PIL_dynlib_get_error_as_string(PILdynlib* lib) {
        int err;
 
        /* if lib is NULL reset the last error code */
+       err= GetLastError();
        if (!lib) {
                SetLastError(ERROR_SUCCESS);
-               return NULL;
+               err = ERROR_SUCCESS;
        }
 
-       err= GetLastError();
        if (err) {
                static char buf[1024];
 
@@ -96,7 +96,7 @@ char *PIL_dynlib_get_error_as_string(PILdynlib* lib) {
                        return buf;
        }
        
-       return NULL;
+       return "unrecognized error";
 }
 
 void PIL_dynlib_close(PILdynlib *lib) {
index 3e1c8afb7a8a26fe0f56049fec3cd9d07c774ce4..603c85655d75b3f48432eaece803d8ea187c390a 100644 (file)
@@ -77,8 +77,12 @@ void BLI_edgehash_insert(EdgeHash *eh, int v0, int v1, void *val) {
        unsigned int hash;
        Entry *e= malloc(sizeof(*e));
 
-       if (v1<v0) v0 ^= v1 ^= v0 ^= v1;
-       hash = EDGEHASH(v0,v1)%eh->nbuckets;
+       if (v1<v0) {
+               v0 ^= v1;
+               v1 ^= v0;
+               v0 ^= v1;
+       }
+       hash = EDGEHASH(v0,v1)%eh->nbuckets;
 
        e->v0 = v0;
        e->v1 = v1;
@@ -114,7 +118,11 @@ void** BLI_edgehash_lookup_p(EdgeHash *eh, int v0, int v1) {
        unsigned int hash;
        Entry *e;
 
-       if (v1<v0) v0 ^= v1 ^= v0 ^= v1;
+       if (v1<v0) {
+               v0 ^= v1;
+               v1 ^= v0;
+               v0 ^= v1;
+       }
        hash = EDGEHASH(v0,v1)%eh->nbuckets;
        for (e= eh->buckets[hash]; e; e= e->next)
                if (v0==e->v0 && v1==e->v1)
index 74f152ac635ffb206158edf5d551be5e6a0a883c..48a40db6a72e1849d013ad4103e35b0eaf21a5b4 100644 (file)
@@ -404,8 +404,6 @@ static VFontData *objfnt_to_ftvfontdata(PackedFile * pf)
                        break;
                lcode = charcode;
        }
-       
-       err = FT_Select_Charmap( face, FT_ENCODING_UNICODE );
 
        return vfd;     
 }
index c27efcb7934f82d442c04ab85878cb4108f03c2d..9dfe9557c1b80c4d5840295a7452760f2b473ac2 100644 (file)
@@ -1955,7 +1955,7 @@ int BLI_strncasecmp(const char *s1, const char *s2, int n) {
 #include "iconv.h"
 #include "localcharset.h"
 
-void BLI_string_to_utf8(char *original, char *utf_8, char *code)
+void BLI_string_to_utf8(char *original, char *utf_8, const char *code)
 {
        size_t inbytesleft=strlen(original);
        size_t outbytesleft=512;
index 928def7705926a5dbac520bf8bdc590b788be543..797c986b7d082c05f3f7b1d8e52a88df6721001b 100644 (file)
 #include "BKE_object.h"
 #include "BKE_particle.h"
 #include "BKE_pointcache.h"
-#include "BKE_property.h" // for get_property
+#include "BKE_property.h" // for get_ob_property
 #include "BKE_sca.h" // for init_actuator
 #include "BKE_scene.h"
 #include "BKE_softbody.h"      // sbNew()
@@ -5329,7 +5329,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                        while (act) {
                                if(act->type==ACT_IPO) {
                                        ia= act->data;
-                                       prop= get_property(ob, ia->name);
+                                       prop= get_ob_property(ob, ia->name);
                                        if(prop) {
                                                ia->type= ACT_IPO_FROM_PROP;
                                        }
@@ -7830,6 +7830,25 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                }
        }
 
+       if (main->versionfile < 247 || (main->versionfile == 247 && main->subversionfile < 3)){
+               Object *ob;
+               for(ob = main->object.first; ob; ob= ob->id.next) {
+                       // Starting from subversion 3, ACTOR is a separate feature.
+                       // Before it was conditioning all the other dynamic flags
+                       if (!(ob->gameflag & OB_ACTOR))
+                               ob->gameflag &= ~(OB_GHOST|OB_DYNAMIC|OB_RIGID_BODY|OB_SOFT_BODY|OB_COLLISION_RESPONSE);
+               }
+       }
+
+       if (main->versionfile < 247 || (main->versionfile == 247 && main->subversionfile < 4)){
+               Scene *sce= main->scene.first;
+               while(sce) {
+                       if(sce->frame_step==0)
+                               sce->frame_step= 1;
+                       sce= sce->id.next;
+               }
+       }
+
        /* WATCH IT!!!: pointers from libdata have not been converted yet here! */
        /* WATCH IT 2!: Userdef struct init has to be in src/usiblender.c! */
 
index d3faa81ebb136cc8d23818894a9a45fb92cb7a8c..3813fe3da8ec8cb25fc5d002230ebb561ef1e5f4 100644 (file)
@@ -108,8 +108,8 @@ void GPU_framebuffer_restore();
    - only for fragment shaders now
    - must call texture bind before setting a texture as uniform! */
 
-GPUShader *GPU_shader_create(const char *vertexcode, const char *fragcode, GPUShader *lib);
-GPUShader *GPU_shader_create_lib(const char *code);
+GPUShader *GPU_shader_create(const char *vertexcode, const char *fragcode, const char *libcode); /*GPUShader *lib);*/
+/*GPUShader *GPU_shader_create_lib(const char *code);*/
 void GPU_shader_free(GPUShader *shader);
 
 void GPU_shader_bind(GPUShader *shader);
index 78a99cab44719da3f231f690bed9e59b5d9a4d9a..1c29bdc8741d46772d8b5b816e76e4f068d7eb69 100644 (file)
@@ -188,8 +188,8 @@ static void BLI_dynstr_printf(DynStr *dynstr, const char *format, ...)
  * These are stored in a hash for lookup when creating a material. */
 
 static GHash *FUNCTION_HASH= NULL;
-static char *FUNCTION_PROTOTYPES= NULL;
-static GPUShader *FUNCTION_LIB= NULL;
+/*static char *FUNCTION_PROTOTYPES= NULL;
+static GPUShader *FUNCTION_LIB= NULL;*/
 
 static int gpu_str_prefix(char *str, char *prefix)
 {
@@ -299,6 +299,7 @@ static void gpu_parse_functions_string(GHash *hash, char *code)
        }
 }
 
+#if 0
 static char *gpu_generate_function_prototyps(GHash *hash)
 {
        DynStr *ds = BLI_dynstr_new();
@@ -346,14 +347,15 @@ static char *gpu_generate_function_prototyps(GHash *hash)
 
        return prototypes;
 }
+#endif
 
 GPUFunction *GPU_lookup_function(char *name)
 {
        if(!FUNCTION_HASH) {
                FUNCTION_HASH = BLI_ghash_new(BLI_ghashutil_strhash, BLI_ghashutil_strcmp);
                gpu_parse_functions_string(FUNCTION_HASH, datatoc_gpu_shader_material_glsl);
-               FUNCTION_PROTOTYPES = gpu_generate_function_prototyps(FUNCTION_HASH);
-               FUNCTION_LIB = GPU_shader_create_lib(datatoc_gpu_shader_material_glsl);
+               /*FUNCTION_PROTOTYPES = gpu_generate_function_prototyps(FUNCTION_HASH);
+               FUNCTION_LIB = GPU_shader_create_lib(datatoc_gpu_shader_material_glsl);*/
        }
 
        return (GPUFunction*)BLI_ghash_lookup(FUNCTION_HASH, name);
@@ -370,14 +372,14 @@ void GPU_extensions_exit(void)
                BLI_ghash_free(FUNCTION_HASH, NULL, (GHashValFreeFP)MEM_freeN);
                FUNCTION_HASH = NULL;
        }
-       if(FUNCTION_PROTOTYPES) {
+       /*if(FUNCTION_PROTOTYPES) {
                MEM_freeN(FUNCTION_PROTOTYPES);
                FUNCTION_PROTOTYPES = NULL;
-       }
-       if(FUNCTION_LIB) {
+       }*/
+       /*if(FUNCTION_LIB) {
                GPU_shader_free(FUNCTION_LIB);
                FUNCTION_LIB = NULL;
-       }
+       }*/
 }
 
 /* GLSL code generation */
@@ -688,7 +690,7 @@ static char *code_generate_fragment(ListBase *nodes, GPUOutput *output, const ch
        DynStr *ds = BLI_dynstr_new();
        char *code;
 
-       BLI_dynstr_append(ds, FUNCTION_PROTOTYPES);
+       /*BLI_dynstr_append(ds, FUNCTION_PROTOTYPES);*/
 
        codegen_set_unique_ids(nodes);
        codegen_print_uniforms_functions(ds, nodes);
@@ -1393,10 +1395,10 @@ GPUPass *GPU_generate_pass(ListBase *nodes, GPUNodeLink *outlink, GPUVertexAttri
        GPUPass *pass;
        char *vertexcode, *fragmentcode;
 
-       if(!FUNCTION_LIB) {
+       /*if(!FUNCTION_LIB) {
                GPU_nodes_free(nodes);
                return NULL;
-       }
+       }*/
 
        /* prune unused nodes */
        gpu_nodes_prune(nodes, outlink);
@@ -1407,7 +1409,7 @@ GPUPass *GPU_generate_pass(ListBase *nodes, GPUNodeLink *outlink, GPUVertexAttri
        /* generate code and compile with opengl */
        fragmentcode = code_generate_fragment(nodes, outlink->output, name);
        vertexcode = code_generate_vertex(nodes);
-       shader = GPU_shader_create(vertexcode, fragmentcode, FUNCTION_LIB);
+       shader = GPU_shader_create(vertexcode, fragmentcode, datatoc_gpu_shader_material_glsl); /*FUNCTION_LIB);*/
        MEM_freeN(fragmentcode);
        MEM_freeN(vertexcode);
 
index 4c3090dd2c1c77998214ace436d9eb10f8000166..a8dc369460cd656c1d1270116d832c046decb9ff 100644 (file)
@@ -40,6 +40,7 @@
 
 #include "BKE_image.h"
 #include "BKE_global.h"
+#include "BKE_utildefines.h"
 
 #include "IMB_imbuf.h"
 #include "IMB_imbuf_types.h"
@@ -154,7 +155,6 @@ struct GPUTexture {
        int depth;                              /* is a depth texture? */
 };
 
-#define FTOCHAR(val) val<=0.0f?0: (val>=1.0f?255: (char)(255.0f*val))
 static unsigned char *GPU_texture_convert_pixels(int length, float *fpixels)
 {
        unsigned char *pixels, *p;
@@ -669,11 +669,13 @@ static void shader_print_errors(char *task, char *log, const char *code)
        fprintf(stderr, "%s\n", log);
 }
 
-GPUShader *GPU_shader_create(const char *vertexcode, const char *fragcode, GPUShader *lib)
+GPUShader *GPU_shader_create(const char *vertexcode, const char *fragcode, /*GPUShader *lib,*/ const char *libcode)
 {
        GLint status;
        GLcharARB log[5000];
+       const char *fragsource[2];
        GLsizei length = 0;
+       GLint count;
        GPUShader *shader;
 
        if (!GLEW_ARB_vertex_shader || !GLEW_ARB_fragment_shader)
@@ -712,8 +714,12 @@ GPUShader *GPU_shader_create(const char *vertexcode, const char *fragcode, GPUSh
        }
 
        if(fragcode) {
+               count = 0;
+               if(libcode) fragsource[count++] = libcode;
+               if(fragcode) fragsource[count++] = fragcode;
+
                glAttachObjectARB(shader->object, shader->fragment);
-               glShaderSourceARB(shader->fragment, 1, (const char**)&fragcode, NULL);
+               glShaderSourceARB(shader->fragment, count, fragsource, NULL);
 
                glCompileShaderARB(shader->fragment);
                glGetObjectParameterivARB(shader->fragment, GL_OBJECT_COMPILE_STATUS_ARB, &status);
@@ -727,8 +733,8 @@ GPUShader *GPU_shader_create(const char *vertexcode, const char *fragcode, GPUSh
                }
        }
 
-       if(lib && lib->lib)
-               glAttachObjectARB(shader->object, lib->lib);
+       /*if(lib && lib->lib)
+               glAttachObjectARB(shader->object, lib->lib);*/
 
        glLinkProgramARB(shader->object);
        glGetObjectParameterivARB(shader->object, GL_OBJECT_LINK_STATUS_ARB, &status);
@@ -743,6 +749,7 @@ GPUShader *GPU_shader_create(const char *vertexcode, const char *fragcode, GPUSh
        return shader;
 }
 
+#if 0
 GPUShader *GPU_shader_create_lib(const char *code)
 {
        GLint status;
@@ -778,6 +785,7 @@ GPUShader *GPU_shader_create_lib(const char *code)
 
        return shader;
 }
+#endif
 
 void GPU_shader_bind(GPUShader *shader)
 {
index 84588b52573a1bfa31d34c78c3c6fe972e6d150b..8043e594454427d814f48889f2b11b9181ac10c6 100644 (file)
@@ -38,6 +38,7 @@
 #include "IMB_imbuf.h"
 #include "IMB_allocimbuf.h"
 #include "IMB_divers.h"
+#include "BKE_utildefines.h"
 
 void imb_checkncols(struct ImBuf *ibuf)
 {
@@ -171,7 +172,6 @@ void IMB_gamwarp(struct ImBuf *ibuf, double gamma)
        }
 }
 
-#define FTOCHAR(val) val<=0.0f?0: (val>=1.0f?255: (char)(255.99f*val))
 
 void IMB_rect_from_float(struct ImBuf *ibuf)
 {
index a8ddb271309180417c9f6c44274ed23eb20ebac9..56714c3b481850e00642ead9a9df110270f4270a 100644 (file)
@@ -37,6 +37,7 @@
 #include "IMB_imbuf.h"
 
 #include "IMB_allocimbuf.h"
+#include "BKE_utildefines.h"
 
 /* blend modes */
 
@@ -514,10 +515,6 @@ void IMB_rectfill(struct ImBuf *drect, float col[4])
        }       
 }
 
-/* maybe we should use BKE_utildefines.h */
-#define FTOCHAR(val) (val<=0.0f ? 0: (val>=1.0f ? 255: (char)(255.99f*val)))
-#define CLAMP(a, b, c)         if((a)<(b)) (a)=(b); else if((a)>(c)) (a)=(c)
-#define SWAP(type, a, b)        { type sw_ap; sw_ap=(a); (a)=(b); (b)=sw_ap; }
 
 void buf_rectfill_area(unsigned char *rect, float *rectf, int width, int height, float *col, int x1, int y1, int x2, int y2)
 {
index b353e7bb45cbc135683e804776679de4e99a4b18..be30a3eaaf354b61a73f4a89882468454963604c 100644 (file)
@@ -52,6 +52,7 @@ struct Sequence*      find_next_prev_sequence(struct Sequence *test, int lr, int sel)
 struct Sequence*       find_nearest_seq(int *hand);
 int                                    insert_gap(int gap, int cfra);
 void                           make_meta(void);
+void                           select_single_seq(struct Sequence *seq, int deselect_all);
 void                           select_channel_direction(struct Sequence *test,int lr);
 void                           select_more_seq(void);
 void                           select_less_seq(void);
index abf8b58b1c9cd259fd7659fc9eefc2def153092d..fcd206bb8282120c871a95fc58b3893d79875598 100644 (file)
@@ -41,7 +41,7 @@ typedef struct TreeElement {
        short idcode;           // from TreeStore id
        short xend;             // width of item display, for select
        char *name;
-       void *directdata;       // Armature Bones, Base, ...
+       void *directdata;       // Armature Bones, Base, Sequence, Strip...
 }  TreeElement;
 
 /* TreeElement->flag */
@@ -77,6 +77,9 @@ typedef struct TreeElement {
 #define TSE_LINKED_LAMP                23
 #define TSE_POSEGRP_BASE       24
 #define TSE_POSEGRP                    25
+#define TSE_SEQUENCE   26
+#define TSE_SEQ_STRIP  27
+#define TSE_SEQUENCE_DUP 28
 
 /* outliner search flags */
 #define OL_FIND                                        0
index a7f7bc2e4b86e48fcd93cae0635fae87ceaa4a8f..5a883dc9e21a331fee5bc3da4533aed6700bc345 100644 (file)
 #define        F_CFRA                  ((float)(G.scene->r.cfra))
 #define        SFRA                    (G.scene->r.sfra)
 #define        EFRA                    (G.scene->r.efra)
+#define STFRA                  (G.scene->frame_step)
 #define PSFRA                  ((G.scene->r.psfra != 0)? (G.scene->r.psfra): (G.scene->r.sfra))
 #define PEFRA                  ((G.scene->r.psfra != 0)? (G.scene->r.pefra): (G.scene->r.efra))
 #define FRA2TIME(a)           ((((double) G.scene->r.frs_sec_base) * (a)) / G.scene->r.frs_sec)
 /* for curve objects in editmode that can have hidden handles - may use for IPO's later */
 #define BEZSELECTED_HIDDENHANDLES(bezt)   ((G.f & G_HIDDENHANDLES) ? (bezt)->f2 & SELECT : BEZSELECTED(bezt))
 
+#define BEZ_SEL(bezt)          { (bezt)->f1 |=  SELECT; (bezt)->f2 |=  SELECT; (bezt)->f3 |=  SELECT; }
+#define BEZ_DESEL(bezt)                { (bezt)->f1 &= ~SELECT; (bezt)->f2 &= ~SELECT; (bezt)->f3 &= ~SELECT; }
+#define BEZ_INVSEL(bezt)       { (bezt)->f1 ^=  SELECT; (bezt)->f2 ^=  SELECT; (bezt)->f3 ^=  SELECT; }
+
 /* psfont */
 #define FNT_PDRAW 1
 #define FNT_HAEBERLI 2
index a4fb8dc115042290940b3e9a33353a9c51ceb58c..3722c365f397dfd1f294ddaf540224b45916db47 100644 (file)
@@ -187,37 +187,6 @@ typedef struct Curve {
        struct CharInfo curinfo;        
 } Curve;
 
-typedef struct IpoDriver {
-       struct Object *ob;
-       short blocktype, adrcode, type, flag;
-       char name[128];  /* bone or constraint(?), or python expression here */
-} IpoDriver;
-
-/* temp? we store more bone names in 1 driver... */
-#define DRIVER_NAME_OFFS       32
-
-typedef struct IpoCurve {
-       struct IpoCurve *next,  *prev;
-       
-       struct BPoint *bp;                                      /* are these even used anywhere? */
-       struct BezTriple *bezt;                         /* array of BezTriples (sizeof(BezTriple)*totvert. i.e.  keyframes  */
-
-       rctf maxrct, totrct;                            /* bounding boxes */
-
-       short blocktype, adrcode, vartype;      /* blocktype= ipo-blocktype; adrcode= type of ipo-curve; vartype= 'format' of data */
-       short totvert;                                          /* total number of BezTriples (i.e. keyframes) on curve */
-       short ipo, extrap;                                      /* interpolation and extrapolation modes  */
-       short flag, rt;                                         /* flag= settings; rt= ??? */
-       float ymin, ymax;                                       /* minimum/maximum y-extents for curve */
-       unsigned int bitmask;                           /* ??? */
-       
-       float slide_min, slide_max;                     /* minimum/maximum values for sliders (in action editor) */
-       float curval;                                           /* value of ipo-curve for current frame */
-       
-       IpoDriver *driver;                                      /* pointer to ipo-driver for this curve */
-       
-} IpoCurve;
-
 /* **************** CURVE ********************* */
 
 /* texflag */
@@ -273,15 +242,5 @@ typedef struct IpoCurve {
 #define CU_UNDERLINE   4
 #define CU_WRAP                        8       /* wordwrap occured here */
 
-/* *************** driver ****************** */
-
-/* driver->type */
-#define        IPO_DRIVER_TYPE_NORMAL 0
-#define        IPO_DRIVER_TYPE_PYTHON 1
-
-/* driver->flag */
-/* invalid flag: currently only used for buggy pydriver expressions: */
-#define IPO_DRIVER_FLAG_INVALID 1
-
 #endif
 
index f517bf14733575ea6284784aef9322b0a2652fe3..5be6dd727c04ec1abbe24f523d9a74f6688e2176 100644 (file)
@@ -24,7 +24,7 @@
  *
  * The Original Code is: all of this file.
  *
- * Contributor(s): none yet.
+ * Contributor(s): Joshua Leung
  *
  * ***** END GPL LICENSE BLOCK *****
  */
 #define DNA_IPO_TYPES_H
 
 #include "DNA_listBase.h"
+#include "DNA_curve_types.h"
 #include "DNA_vec_types.h"
 
 #include "DNA_ID.h"
 
+/* -------------------------- Type Defines --------------------------- */
+
+/* sometimes used - mainly for GE/Ketsji */
+typedef short IPO_Channel;  
+
+
+/* --- IPO Curve Driver --- */
+
+/* IPO Curve Driver */
+typedef struct IpoDriver {
+       struct Object *ob;                      /* target/driver ob */
+       short blocktype, adrcode;       /* sub-channel to use */
+       
+       short type, flag;                       /* driver settings */
+       char name[128];                         /* bone, or python expression here */
+} IpoDriver;
+
+/* --- IPO Curve --- */
+
+/* IPO Curve */
+typedef struct IpoCurve {
+       struct IpoCurve *next,  *prev;
+       
+       struct BPoint *bp;                                      /* array of BPoints (sizeof(BPoint)*totvert) - i.e. baked/imported data */
+       struct BezTriple *bezt;                         /* array of BezTriples (sizeof(BezTriple)*totvert)  - i.e. user-editable keyframes  */
+
+       rctf maxrct, totrct;                            /* bounding boxes */
+
+       short blocktype, adrcode, vartype;      /* blocktype= ipo-blocktype; adrcode= type of ipo-curve; vartype= 'format' of data */
+       short totvert;                                          /* total number of BezTriples (i.e. keyframes) on curve */
+       short ipo, extrap;                                      /* interpolation and extrapolation modes  */
+       short flag, rt;                                         /* flag= settings; rt= ??? */
+       float ymin, ymax;                                       /* minimum/maximum y-extents for curve */
+       unsigned int bitmask;                           /* ??? */
+       
+       float slide_min, slide_max;                     /* minimum/maximum values for sliders (in action editor) */
+       float curval;                                           /* value of ipo-curve for current frame */
+       
+       IpoDriver *driver;                                      /* pointer to ipo-driver for this curve */
+} IpoCurve;
+
+/* --- ID-Datablock --- */
+
 /* IPO Data-Block */
 typedef struct Ipo {
        ID id;
@@ -47,13 +91,9 @@ typedef struct Ipo {
        short muteipo, pad;                     /* muteipo: either 0 or 1 (whether ipo block is muted) */       
 } Ipo;
 
-/* NOTE: IpoCurve struct is defined in DNA_curve_types.h, not in here... */
-
-/* sometimes used */
-typedef short IPO_Channel;  
+/* ----------- adrcodes (for matching ipo-curves to data) ------------- */
 
 /* defines: are these duped or new? */
-
 #define IPOBUTY        17
 
 #define TOB_IPO        1
@@ -64,7 +104,7 @@ typedef short IPO_Channel;
 #define IPO_DISPBITS   2
 #define IPO_DISPTIME   3
 
-/* ******************** */
+/* ********** Object (ID_OB) ********** */
 
 #define OB_TOTIPO      30
 #define OB_TOTNAM      30
@@ -110,7 +150,7 @@ typedef short IPO_Channel;
 #define OB_ROT_DIFF    100
 
 
-/* ******************** */
+/* ********** Material (ID_MA) ********** */
 
 #define MA_TOTIPO      40
 #define MA_TOTNAM      26
@@ -179,7 +219,7 @@ typedef short IPO_Channel;
 #define MAP_VARF       13
 #define MAP_DISP       14
 
-/* ******************** */
+/* ********** Texture (ID_TE) ********** */
 
 #define TE_TOTIPO      26
 #define TE_TOTNAM      26
@@ -216,21 +256,21 @@ typedef short IPO_Channel;
 #define TE_BRIGHT      25
 #define TE_CONTRA      26
 
-/* ******************** */
+/* ******** Sequence (ID_SEQ) ********** */
 
 #define SEQ_TOTIPO     1
 #define SEQ_TOTNAM     1
 
 #define SEQ_FAC1       1
 
-/* ******************** */
+/* ********* Curve (ID_CU) *********** */
 
 #define CU_TOTIPO      1
 #define CU_TOTNAM      1
 
 #define CU_SPEED       1
 
-/* ******************** */
+/* ********* ShapeKey (ID_KE) *********** */
 
 #define KEY_TOTIPO     64
 #define KEY_TOTNAM     64
@@ -238,7 +278,7 @@ typedef short IPO_Channel;
 #define KEY_SPEED      0
 #define KEY_NR         1
 
-/* ******************** */
+/* ********* World (ID_WO) *********** */
 
 #define WO_TOTIPO      29
 #define WO_TOTNAM      16
@@ -263,7 +303,7 @@ typedef short IPO_Channel;
 #define WO_STARDIST    15
 #define WO_STARSIZE    16
 
-/* ******************** */
+/* ********** Lamp (ID_LA) ********** */
 
 #define LA_TOTIPO      21
 #define LA_TOTNAM      10
@@ -279,9 +319,8 @@ typedef short IPO_Channel;
 #define LA_QUAD2       9
 #define LA_HALOINT     10
 
-/* ******************** */
+/* ********* Camera (ID_CA) ************ */
 
-/* yafray: totipo & totnam +2 because of added curves */
 #define CAM_TOTIPO     7
 #define CAM_TOTNAM     7
 
@@ -296,7 +335,7 @@ typedef short IPO_Channel;
 #define CAM_SHIFT_X            6
 #define CAM_SHIFT_Y            7
 
-/* ******************** */
+/* ********* Sound (ID_SO) *********** */
 
 #define SND_TOTIPO     4
 #define SND_TOTNAM     4
@@ -306,9 +345,9 @@ typedef short IPO_Channel;
 #define SND_PANNING    3
 #define SND_ATTEN      4
 
-/* ******************** */
+/* ******* PoseChannel (ID_PO) ********* */
 
-#define AC_TOTIPO      10      /* __NLA */
+#define AC_TOTIPO      10
 #define AC_TOTNAM      10
 
 #define AC_LOC_X       1
@@ -324,25 +363,15 @@ typedef short IPO_Channel;
 #define AC_QUAT_Y      27
 #define AC_QUAT_Z      28
 
-/* ******************** */
-#define CO_TOTIPO      2       /* Constraint Ipos */
+/* ******** Constraint (ID_CO) ********** */
+
+#define CO_TOTIPO      2
 #define CO_TOTNAM      2
 
 #define CO_ENFORCE     1
 #define CO_HEADTAIL    2
-/*
-#define        CO_TIME         2
-#define CO_OFFSET_X    3
-#define CO_OFFSET_Y    4
-#define CO_OFFSET_Z    5
-#define CO_ORIENT_X    6
-#define CO_ORIENT_Y    7
-#define CO_ORIENT_Z    8
-#define CO_ROLL                9
-*/
 
-/* ******************** */
-/* fluidsim ipos NT */
+/* ****** FluidSim (ID_FLUIDSIM) ****** */
 
 #define FLUIDSIM_TOTIPO        13
 #define FLUIDSIM_TOTNAM        13
@@ -367,6 +396,8 @@ typedef short IPO_Channel;
 
 /* ******************** */
 /* particle ipos */
+
+/* ******* Particle (ID_PA) ******** */
 #define PART_TOTIPO            25
 #define PART_TOTNAM            25
 
@@ -403,8 +434,9 @@ typedef short IPO_Channel;
 #define PART_PD2_FMAXD 25
 
 
-/* these are IpoCurve specific */
-/* **************** IPO ********************* */
+/* -------------------- Defines: Flags and Types ------------------ */
+
+/* ----- IPO Curve Defines ------- */
 
 /* icu->vartype */
 #define IPO_CHAR               0
@@ -414,6 +446,7 @@ typedef short IPO_Channel;
 #define IPO_FLOAT              4
 #define IPO_DOUBLE             5
 #define IPO_FLOAT_DEGR 6
+
        /* very special case, in keys */
 #define IPO_BEZTRIPLE  100
 #define IPO_BPOINT             101
@@ -428,7 +461,8 @@ typedef short IPO_Channel;
 #define IPO_CONST              0
 #define IPO_LIN                        1
 #define IPO_BEZ                        2
-#define IPO_MIXED              3 /* not used yet */
+       /* not used yet */
+#define IPO_MIXED              3 
 
 /* icu->extrap */
 #define IPO_HORIZ              0
@@ -446,6 +480,19 @@ typedef short IPO_Channel;
 #define IPO_PROTECT            64
 #define IPO_MUTE               128
 
+/* ---------- IPO Drivers ----------- */
+
+/* offset in driver->name for finding second posechannel for rot-diff  */
+#define DRIVER_NAME_OFFS       32 
+
+/* driver->type */
+#define        IPO_DRIVER_TYPE_NORMAL          0
+#define        IPO_DRIVER_TYPE_PYTHON          1
+
+/* driver->flag */
+       /* invalid flag: currently only used for buggy pydriver expressions */
+#define IPO_DRIVER_FLAG_INVALID        (1<<0)
+
 #endif
 
 
index 2a39580bb5ca60b6653da9d837865236be915e51..bc746e998640d31cf4ea615af08415aa7b72d4ea 100644 (file)
@@ -50,6 +50,7 @@ typedef struct Lamp {
        
        short colormodel, totex;
        float r, g, b, k;
+       float shdwr, shdwg, shdwb, shdwpad;
        
        float energy, dist, spotsize, spotblend;
        float haint;
@@ -138,6 +139,7 @@ typedef struct Lamp {
 /* Since it is used with LOCAL lamp, can't use LA_SHAD */
 #define LA_YF_SOFT             16384
 #define LA_LAYER_SHADOW        32768
+#define LA_SHAD_TEX     (1<<16)
 
 /* layer_shadow */
 #define LA_LAYER_SHADOW_BOTH   0
@@ -190,6 +192,7 @@ typedef struct Lamp {
 
 /* mapto */
 #define LAMAP_COL              1
+#define LAMAP_SHAD             2
 
 
 #endif /* DNA_LAMP_TYPES_H */
index 32522d1e866adc69a77945236c3eabf1c7add6a6..3888cb48520f798853d2a8bc830add990dd6efe0 100644 (file)
@@ -553,6 +553,10 @@ typedef struct Scene {
 
        /* Sculptmode data */
        struct SculptData sculptdata;
+
+       /* frame step. */
+       int frame_step;
+       int pad;
 } Scene;
 
 
index c59cafc1ef03af9723dfc6da53c2b64e8d272464..226a3ecd834da2b27dfd3bcd1ba3ae13f7390c0c 100644 (file)
@@ -589,6 +589,7 @@ typedef struct SpaceImaSel {
 #define SO_LIBRARIES   7
 #define SO_VERSE_SESSION       8
 #define SO_VERSE_MS            9
+#define SO_SEQUENCE            10
 
 /* SpaceOops->storeflag */
 #define SO_TREESTORE_CLEANUP   1
index 4b96ef3fdf0bca0849f44102b2d58a71598c4a39..aac3c51b97ebbeaf4446d9a352c016f2ed0d615b 100644 (file)
@@ -100,7 +100,7 @@ extern "C" {
 
        void BPY_clear_bad_scriptlinks( struct Text *byebye );
        int BPY_has_onload_script( void );
-       void BPY_do_all_scripts( short event );
+       void BPY_do_all_scripts( short event, short anim );
        int BPY_check_all_scriptlinks( struct Text *text );
        void BPY_do_pyscript( struct ID *id, short event );
        void BPY_free_scriptlink( struct ScriptLink *slink );
@@ -112,7 +112,7 @@ extern "C" {
        int BPY_has_spacehandler(struct Text *text, struct ScrArea *sa);
        void BPY_screen_free_spacehandlers(struct bScreen *sc);
        int BPY_do_spacehandlers(struct ScrArea *sa, unsigned short event,
-               unsigned short space_event);
+               short eventValue, unsigned short space_event);
 
        void BPY_pydriver_update(void);
        float BPY_pydriver_eval(struct IpoDriver *driver);
index 041ba0699286358a8b650195e2d2bd1cef64a780..31609970f6f8a960763d293fc29845db302e160d 100644 (file)
@@ -2163,8 +2163,14 @@ void BPY_clear_bad_scriptlinks( struct Text *byebye )
 *      For the scene, only the current active scene the scripts are 
 *      executed (if any).
 *****************************************************************************/
-void BPY_do_all_scripts( short event )
+void BPY_do_all_scripts( short event, short anim )
 {
+       /* during stills rendering we disable FRAMECHANGED events */
+       static char disable_frame_changed = 0;
+
+       if ((event == SCRIPT_FRAMECHANGED) && disable_frame_changed)
+               return;
+
        DoAllScriptsFromList( &( G.main->object ), event );
        DoAllScriptsFromList( &( G.main->lamp ), event );
        DoAllScriptsFromList( &( G.main->camera ), event );
@@ -2180,9 +2186,12 @@ void BPY_do_all_scripts( short event )
         * "import sys; sys.setcheckinterval(sys.maxint)" */
        if (event == SCRIPT_RENDER) {
                _Py_CheckInterval = PyInt_GetMax();
+               if (!anim)
+                       disable_frame_changed = 1;
        }
        else if (event == SCRIPT_POSTRENDER) {
                _Py_CheckInterval = 100; /* Python default */
+               disable_frame_changed = 0;
        }
 
        return;
@@ -2466,7 +2475,7 @@ int BPY_add_spacehandler(Text *text, ScrArea *sa, char spacetype)
 }
 
 int BPY_do_spacehandlers( ScrArea *sa, unsigned short event,
-       unsigned short space_event )
+       short eventValue, unsigned short space_event )
 {
        ScriptLink *scriptlink;
        int retval = 0;
@@ -2506,8 +2515,9 @@ int BPY_do_spacehandlers( ScrArea *sa, unsigned short event,
                PyDict_SetItemString(g_blenderdict, "bylink", Py_True);
                /* unlike normal scriptlinks, here Blender.link is int (space event type) */
                EXPP_dict_set_item_str(g_blenderdict, "link", PyInt_FromLong(space_event));
-               /* note: DRAW space_events set event to 0 */
+               /* note: DRAW space_events set event and val to 0 */
                EXPP_dict_set_item_str(g_blenderdict, "event", PyInt_FromLong(event));
+               EXPP_dict_set_item_str(g_blenderdict, "eventValue", PyInt_FromLong(eventValue));
                /* now run all assigned space handlers for this space and space_event */
                for( index = 0; index < scriptlink->totscript; index++ ) {
                        
index 87c605ef612a242c02104453703bd52d6eb6be73..af93a1130cb3631e6e40c98005f6c1cc5caadf68 100644 (file)
@@ -36,6 +36,7 @@
 #include "BKE_utildefines.h"
 #include "BLI_blenlib.h"
 #include "BLI_arithb.h" /* for M_PI */
+#include "DNA_userdef_types.h"
 #include "BSE_editipo.h"
 #include "BIF_keyframing.h"
 #include "BIF_space.h"
@@ -1032,18 +1033,21 @@ static PyObject *Camera_repr( BPy_Camera * self )
 
 static PyObject *Camera_insertIpoKey( BPy_Camera * self, PyObject * args )
 {
-       int key = 0;
+       int key = 0, flag = 0;
 
        if( !PyArg_ParseTuple( args, "i", &( key ) ) )
                return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
                                                                                "expected int argument" ) );
-
+       
+       /* flag should be initialised with the 'autokeying' flags like for normal keying */
+       if (IS_AUTOKEY_FLAG(INSERTNEEDED)) flag |= INSERTKEY_NEEDED;
+       
        if (key == IPOKEY_LENS){
-               insertkey((ID *)self->camera, ID_CA, NULL, NULL, CAM_LENS, 0);     
+               insertkey((ID *)self->camera, ID_CA, NULL, NULL, CAM_LENS, flag);     
        }
        else if (key == IPOKEY_CLIPPING){
-               insertkey((ID *)self->camera, ID_CA, NULL, NULL, CAM_STA, 0);
-               insertkey((ID *)self->camera, ID_CA, NULL, NULL, CAM_END, 0);   
+               insertkey((ID *)self->camera, ID_CA, NULL, NULL, CAM_STA, flag);
+               insertkey((ID *)self->camera, ID_CA, NULL, NULL, CAM_END, flag);   
        }
 
        allspace(REMAKEIPO, 0);
index 8263bf2022f6a41720ce4e07571ccf5329c310c0..6f474d4d167010306b55d62b9fd2d78640c4185f 100644 (file)
@@ -31,7 +31,7 @@
 #define EXPP_IPOCURVE_H
 
 #include <Python.h>
-#include "DNA_curve_types.h"   /* declaration of IpoCurve */
+#include "DNA_ipo_types.h"     /* declaration of IpoCurve */
 
 /*****************************************************************************/
 /* Python C_IpoCurve structure definition:                                   */
index 38968b64cf51a569da080ec165b9848fb0ac8ea1..799833d4ee01cd649cefc95eea70c9b6a5be60ff 100644 (file)
@@ -46,6 +46,7 @@
 #include "gen_utils.h"
 #include "gen_library.h"
 #include "BKE_utildefines.h"
+#include "DNA_userdef_types.h"
 #include "MEM_guardedalloc.h"
 
 /*****************************************************************************/
@@ -1336,7 +1337,7 @@ static int Lamp_setIpo( BPy_Lamp * self, PyObject * value )
 
 static PyObject *Lamp_insertIpoKey( BPy_Lamp * self, PyObject * args )
 {
-       int key = 0, map;
+       int key = 0, flag = 0, map;
 
        if( !PyArg_ParseTuple( args, "i", &( key ) ) )
                return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
@@ -1344,26 +1345,29 @@ static PyObject *Lamp_insertIpoKey( BPy_Lamp * self, PyObject * args )
 
        map = texchannel_to_adrcode(self->lamp->texact);
 
+       /* flag should be initialised with the 'autokeying' flags like for normal keying */
+       if (IS_AUTOKEY_FLAG(INSERTNEEDED)) flag |= INSERTKEY_NEEDED;
+       
        if (key == IPOKEY_RGB ) {
-               insertkey((ID *)self->lamp, ID_LA, NULL, NULL, LA_COL_R, 0);
-               insertkey((ID *)self->lamp, ID_LA, NULL, NULL,LA_COL_G, 0);
-               insertkey((ID *)self->lamp, ID_LA, NULL, NULL,LA_COL_B, 0);
+               insertkey((ID *)self->lamp, ID_LA, NULL, NULL, LA_COL_R, flag);
+               insertkey((ID *)self->lamp, ID_LA, NULL, NULL,LA_COL_G, flag);
+               insertkey((ID *)self->lamp, ID_LA, NULL, NULL,LA_COL_B, flag);
        }
        if (key == IPOKEY_ENERGY ) {
-               insertkey((ID *)self->lamp, ID_LA, NULL, NULL,LA_ENERGY, 0);
+               insertkey((ID *)self->lamp, ID_LA, NULL, NULL,LA_ENERGY, flag);
        }       
        if (key == IPOKEY_SPOTSIZE ) {
-               insertkey((ID *)self->lamp, ID_LA, NULL, NULL,LA_SPOTSI, 0);
+               insertkey((ID *)self->lamp, ID_LA, NULL, NULL,LA_SPOTSI, flag);
        }
        if (key == IPOKEY_OFFSET ) {
-               insertkey((ID *)self->lamp, ID_LA, NULL, NULL, map+MAP_OFS_X, 0);
-               insertkey((ID *)self->lamp, ID_LA, NULL, NULL, map+MAP_OFS_Y, 0);
-               insertkey((ID *)self->lamp, ID_LA, NULL, NULL, map+MAP_OFS_Z, 0);
+               insertkey((ID *)self->lamp, ID_LA, NULL, NULL, map+MAP_OFS_X, flag);
+               insertkey((ID *)self->lamp, ID_LA, NULL, NULL, map+MAP_OFS_Y, flag);
+               insertkey((ID *)self->lamp, ID_LA, NULL, NULL, map+MAP_OFS_Z, flag);
        }
        if (key == IPOKEY_SIZE ) {
-               insertkey((ID *)self->lamp, ID_LA, NULL, NULL, map+MAP_SIZE_X, 0);
-               insertkey((ID *)self->lamp, ID_LA, NULL, NULL, map+MAP_SIZE_Y, 0);
-               insertkey((ID *)self->lamp, ID_LA, NULL, NULL, map+MAP_SIZE_Z, 0);
+               insertkey((ID *)self->lamp, ID_LA, NULL, NULL, map+MAP_SIZE_X, flag);
+               insertkey((ID *)self->lamp, ID_LA, NULL, NULL, map+MAP_SIZE_Y, flag);
+               insertkey((ID *)self->lamp, ID_LA, NULL, NULL, map+MAP_SIZE_Z, flag);
        }
 
        allspace(REMAKEIPO, 0);
index b118bdb30e734296e54b8c064b6c7a68a0520cb5..d3bb6c8d15867fcab5df34fc6b9004b4a88280f3 100644 (file)
@@ -32,6 +32,7 @@
 
 #include "DNA_space_types.h"
 #include "DNA_material_types.h"
+#include "DNA_userdef_types.h"
 #include "BKE_main.h"
 #include "BKE_global.h"
 #include "BKE_library.h"
@@ -1873,7 +1874,7 @@ static int Material_setIpo( BPy_Material * self, PyObject * value )
 
 static PyObject *Material_insertIpoKey( BPy_Material * self, PyObject * args )
 {
-    int key = 0, map;
+    int key = 0, flag = 0, map;
     
        if( !PyArg_ParseTuple( args, "i", &( key ) ) )
                return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
@@ -1881,59 +1882,62 @@ static PyObject *Material_insertIpoKey( BPy_Material * self, PyObject * args )
                                
        map = texchannel_to_adrcode(self->material->texact);
        
+       /* flag should be initialised with the 'autokeying' flags like for normal keying */
+       if (IS_AUTOKEY_FLAG(INSERTNEEDED)) flag |= INSERTKEY_NEEDED;
+       
        if(key==IPOKEY_RGB || key==IPOKEY_ALLCOLOR) {
-               insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_COL_R, 0);
-               insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_COL_G, 0);
-               insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_COL_B, 0);
+               insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_COL_R, flag);
+               insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_COL_G, flag);
+               insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_COL_B, flag);
        }
        if(key==IPOKEY_ALPHA || key==IPOKEY_ALLCOLOR) {
-               insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_ALPHA, 0);
+               insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_ALPHA, flag);
        }
        if(key==IPOKEY_HALOSIZE || key==IPOKEY_ALLCOLOR) {
-               insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_HASIZE, 0);
+               insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_HASIZE, flag);
        }
        if(key==IPOKEY_MODE || key==IPOKEY_ALLCOLOR) {
-               insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_MODE, 0);
+               insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_MODE, flag);
        }
        if(key==IPOKEY_ALLCOLOR) {
-               insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_SPEC_R, 0);
-               insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_SPEC_G, 0);
-               insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_SPEC_B, 0);
-               insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_REF, 0);
-               insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_EMIT, 0);
-               insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_AMB, 0);
-               insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_SPEC, 0);
-               insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_HARD, 0);
-               insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_MODE, 0);
-               insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_TRANSLU, 0);
-               insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_ADD, 0);
+               insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_SPEC_R, flag);
+               insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_SPEC_G, flag);
+               insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_SPEC_B, flag);
+               insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_REF, flag);
+               insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_EMIT, flag);
+               insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_AMB, flag);
+               insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_SPEC, flag);
+               insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_HARD, flag);
+               insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_MODE, flag);
+               insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_TRANSLU, flag);
+               insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_ADD, flag);
        }
        if(key==IPOKEY_ALLMIRROR) {
-               insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_RAYM, 0);
-               insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_FRESMIR, 0);
-               insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_FRESMIRI, 0);
-               insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_FRESTRA, 0);
-               insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_FRESTRAI, 0);
+               insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_RAYM, flag);
+               insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_FRESMIR, flag);
+               insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_FRESMIRI, flag);
+               insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_FRESTRA, flag);
+               insertkey((ID *)self->material, ID_MA, NULL, NULL, MA_FRESTRAI, flag);
        }
        if(key==IPOKEY_OFS || key==IPOKEY_ALLMAPPING) {
-               insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_OFS_X, 0);
-               insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_OFS_Y, 0);
-               insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_OFS_Z, 0);
+               insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_OFS_X, flag);
+               insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_OFS_Y, flag);
+               insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_OFS_Z, flag);
        }
        if(key==IPOKEY_SIZE || key==IPOKEY_ALLMAPPING) {
-               insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_SIZE_X, 0);
-               insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_SIZE_Y, 0);
-               insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_SIZE_Z, 0);
+               insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_SIZE_X, flag);
+               insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_SIZE_Y, flag);
+               insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_SIZE_Z, flag);
        }
        if(key==IPOKEY_ALLMAPPING) {
-               insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_R, 0);
-               insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_G, 0);
-               insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_B, 0);
-               insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_DVAR, 0);
-               insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_COLF, 0);
-               insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_NORF, 0);
-               insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_VARF, 0);
-               insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_DISP, 0);
+               insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_R, flag);
+               insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_G, flag);
+               insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_B, flag);
+               insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_DVAR, flag);
+               insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_COLF, flag);
+               insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_NORF, flag);
+               insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_VARF, flag);
+               insertkey((ID *)self->material, ID_MA, NULL, NULL, map+MAP_DISP, flag);
        }
 
        allspace(REMAKEIPO, 0);
index 0d5af06377c112c08483fa7021912aad0fb508e0..1e5445cbd80d476200a430cacd5d45c7b10fa91e 100644 (file)
@@ -2568,7 +2568,7 @@ static int Object_setMatrix( BPy_Object * self, MatrixObject * mat )
 static PyObject *Object_insertIpoKey( BPy_Object * self, PyObject * args )
 {
        Object *ob= self->object;
-       int key = 0;
+       int key = 0, flag = 0;
        char *actname= NULL;
 
        if( !PyArg_ParseTuple( args, "i", &key ) )
@@ -2578,35 +2578,39 @@ static PyObject *Object_insertIpoKey( BPy_Object * self, PyObject * args )
        if(ob->ipoflag & OB_ACTION_OB)
                actname= "Object";
        
+       /* flag should be initialised with the 'autokeying' flags like for normal keying */
+       if (IS_AUTOKEY_FLAG(AUTOMATKEY)) flag |= INSERTKEY_MATRIX;
+       if (IS_AUTOKEY_FLAG(INSERTNEEDED)) flag |= INSERTKEY_NEEDED;
+       
        if (key == IPOKEY_LOC || key == IPOKEY_LOCROT || key == IPOKEY_LOCROTSIZE){
-               insertkey((ID *)ob, ID_OB, actname, NULL,OB_LOC_X, 0);
-               insertkey((ID *)ob, ID_OB, actname, NULL,OB_LOC_Y, 0);
-               insertkey((ID *)ob, ID_OB, actname, NULL,OB_LOC_Z, 0);      
+               insertkey((ID *)ob, ID_OB, actname, NULL,OB_LOC_X, flag);
+               insertkey((ID *)ob, ID_OB, actname, NULL,OB_LOC_Y, flag);
+               insertkey((ID *)ob, ID_OB, actname, NULL,OB_LOC_Z, flag);      
        }
        if (key == IPOKEY_ROT || key == IPOKEY_LOCROT || key == IPOKEY_LOCROTSIZE){
-               insertkey((ID *)ob, ID_OB, actname, NULL,OB_ROT_X, 0);
-               insertkey((ID *)ob, ID_OB, actname, NULL,OB_ROT_Y, 0);
-               insertkey((ID *)ob, ID_OB, actname, NULL,OB_ROT_Z, 0);      
+               insertkey((ID *)ob, ID_OB, actname, NULL,OB_ROT_X, flag);
+               insertkey((ID *)ob, ID_OB, actname, NULL,OB_ROT_Y, flag);
+               insertkey((ID *)ob, ID_OB, actname, NULL,OB_ROT_Z, flag);      
        }
        if (key == IPOKEY_SIZE || key == IPOKEY_LOCROTSIZE ){
-               insertkey((ID *)ob, ID_OB, actname, NULL,OB_SIZE_X, 0);
-               insertkey((ID *)ob, ID_OB, actname, NULL,OB_SIZE_Y, 0);
-               insertkey((ID *)ob, ID_OB, actname, NULL,OB_SIZE_Z, 0);      
+               insertkey((ID *)ob, ID_OB, actname, NULL,OB_SIZE_X, flag);
+               insertkey((ID *)ob, ID_OB, actname, NULL,OB_SIZE_Y, flag);
+               insertkey((ID *)ob, ID_OB, actname, NULL,OB_SIZE_Z, flag);      
        }
        if (key == IPOKEY_LAYER ){
-               insertkey((ID *)ob, ID_OB, actname, NULL,OB_LAY, 0);
+               insertkey((ID *)ob, ID_OB, actname, NULL,OB_LAY, flag);
        }
 
        if (key == IPOKEY_PI_STRENGTH ){
-               insertkey((ID *)ob, ID_OB, actname, NULL, OB_PD_FSTR, 0);   
+               insertkey((ID *)ob, ID_OB, actname, NULL, OB_PD_FSTR, flag);   
        } else if (key == IPOKEY_PI_FALLOFF ){
-               insertkey((ID *)ob, ID_OB, actname, NULL, OB_PD_FFALL, 0);   
+               insertkey((ID *)ob, ID_OB, actname, NULL, OB_PD_FFALL, flag);   
        } else if (key == IPOKEY_PI_SURFACEDAMP ){
-               insertkey((ID *)ob, ID_OB, actname, NULL, OB_PD_SDAMP, 0);   
+               insertkey((ID *)ob, ID_OB, actname, NULL, OB_PD_SDAMP, flag);   
        } else if (key == IPOKEY_PI_RANDOMDAMP ){
-               insertkey((ID *)ob, ID_OB, actname, NULL, OB_PD_RDAMP, 0);   
+               insertkey((ID *)ob, ID_OB, actname, NULL, OB_PD_RDAMP, flag);   
        } else if (key == IPOKEY_PI_PERM ){
-               insertkey((ID *)ob, ID_OB, actname, NULL, OB_PD_PERM, 0);   
+               insertkey((ID *)ob, ID_OB, actname, NULL, OB_PD_PERM, flag);   
        }
 
        allspace(REMAKEIPO, 0);
@@ -2630,6 +2634,7 @@ static PyObject *Object_insertPoseKey( BPy_Object * self, PyObject * args )
        BPy_Action *sourceact;
        char *chanName;
        int actframe;
+       int flag=0;
 
 
        /* for doing the time trick, similar to editaction bake_action_with_client() */
@@ -2648,17 +2653,21 @@ static PyObject *Object_insertPoseKey( BPy_Object * self, PyObject * args )
 
        /* XXX: must check chanName actually exists, otherwise segfaults! */
        //achan = get_action_channel(sourceact->action, chanName);
-
-       insertkey(&ob->id, ID_PO, chanName, NULL, AC_LOC_X, 0);
-       insertkey(&ob->id, ID_PO, chanName, NULL, AC_LOC_Y, 0);
-       insertkey(&ob->id, ID_PO, chanName, NULL, AC_LOC_Z, 0);
-       insertkey(&ob->id, ID_PO, chanName, NULL, AC_QUAT_X, 0);
-       insertkey(&ob->id, ID_PO, chanName, NULL, AC_QUAT_Y, 0);
-       insertkey(&ob->id, ID_PO, chanName, NULL, AC_QUAT_Z, 0);
-       insertkey(&ob->id, ID_PO, chanName, NULL, AC_QUAT_W, 0);
-       insertkey(&ob->id, ID_PO, chanName, NULL, AC_SIZE_X, 0);
-       insertkey(&ob->id, ID_PO, chanName, NULL, AC_SIZE_Y, 0);
-       insertkey(&ob->id, ID_PO, chanName, NULL, AC_SIZE_Z, 0);
+       
+       /* flag should be initialised with the 'autokeying' flags like for normal keying */
+       if (IS_AUTOKEY_FLAG(AUTOMATKEY)) flag |= INSERTKEY_MATRIX;
+       if (IS_AUTOKEY_FLAG(INSERTNEEDED)) flag |= INSERTKEY_NEEDED;
+
+       insertkey(&ob->id, ID_PO, chanName, NULL, AC_LOC_X, flag);
+       insertkey(&ob->id, ID_PO, chanName, NULL, AC_LOC_Y, flag);
+       insertkey(&ob->id, ID_PO, chanName, NULL, AC_LOC_Z, flag);
+       insertkey(&ob->id, ID_PO, chanName, NULL, AC_QUAT_X, flag);
+       insertkey(&ob->id, ID_PO, chanName, NULL, AC_QUAT_Y, flag);
+       insertkey(&ob->id, ID_PO, chanName, NULL, AC_QUAT_Z, flag);
+       insertkey(&ob->id, ID_PO, chanName, NULL, AC_QUAT_W, flag);
+       insertkey(&ob->id, ID_PO, chanName, NULL, AC_SIZE_X, flag);
+       insertkey(&ob->id, ID_PO, chanName, NULL, AC_SIZE_Y, flag);
+       insertkey(&ob->id, ID_PO, chanName, NULL, AC_SIZE_Z, flag);
        
        G.scene->r.cfra = oldframe;
 
@@ -2680,6 +2689,7 @@ static PyObject *Object_insertPoseKey( BPy_Object * self, PyObject * args )
 static PyObject *Object_insertCurrentPoseKey( BPy_Object * self, PyObject * args )
 {
        Object *ob= self->object;
+       int flag = 0;
        char *chanName;
 
        /* for doing the time trick, similar to editaction bake_action_with_client() */
@@ -2695,16 +2705,20 @@ static PyObject *Object_insertCurrentPoseKey( BPy_Object * self, PyObject * args
 
        /* XXX: must check chanName actually exists, otherwise segfaults! */
 
-       insertkey(&ob->id, ID_PO, chanName, NULL, AC_LOC_X, 0);
-       insertkey(&ob->id, ID_PO, chanName, NULL, AC_LOC_Y, 0);
-       insertkey(&ob->id, ID_PO, chanName, NULL, AC_LOC_Z, 0);
-       insertkey(&ob->id, ID_PO, chanName, NULL, AC_QUAT_X, 0);
-       insertkey(&ob->id, ID_PO, chanName, NULL, AC_QUAT_Y, 0);
-       insertkey(&ob->id, ID_PO, chanName, NULL, AC_QUAT_Z, 0);
-       insertkey(&ob->id, ID_PO, chanName, NULL, AC_QUAT_W, 0);
-       insertkey(&ob->id, ID_PO, chanName, NULL, AC_SIZE_X, 0);
-       insertkey(&ob->id, ID_PO, chanName, NULL, AC_SIZE_Y, 0);
-       insertkey(&ob->id, ID_PO, chanName, NULL, AC_SIZE_Z, 0);
+       /* flag should be initialised with the 'autokeying' flags like for normal keying */
+       if (IS_AUTOKEY_FLAG(AUTOMATKEY)) flag |= INSERTKEY_MATRIX;
+       if (IS_AUTOKEY_FLAG(INSERTNEEDED)) flag |= INSERTKEY_NEEDED;
+       
+       insertkey(&ob->id, ID_PO, chanName, NULL, AC_LOC_X, flag);
+       insertkey(&ob->id, ID_PO, chanName, NULL, AC_LOC_Y, flag);
+       insertkey(&ob->id, ID_PO, chanName, NULL, AC_LOC_Z, flag);
+       insertkey(&ob->id, ID_PO, chanName, NULL, AC_QUAT_X, flag);
+       insertkey(&ob->id, ID_PO, chanName, NULL, AC_QUAT_Y, flag);
+       insertkey(&ob->id, ID_PO, chanName, NULL, AC_QUAT_Z, flag);
+       insertkey(&ob->id, ID_PO, chanName, NULL, AC_QUAT_W, flag);
+       insertkey(&ob->id, ID_PO, chanName, NULL, AC_SIZE_X, flag);
+       insertkey(&ob->id, ID_PO, chanName, NULL, AC_SIZE_Y, flag);
+       insertkey(&ob->id, ID_PO, chanName, NULL, AC_SIZE_Z, flag);
 
        G.scene->r.cfra = oldframe;
 
@@ -2988,7 +3002,7 @@ static PyObject *Object_getProperty( BPy_Object * self, PyObject * args )
                return EXPP_ReturnPyObjError( PyExc_TypeError,
                                "expected a string" );
 
-       prop = get_property( self->object, prop_name );
+       prop = get_ob_property( self->object, prop_name );
        if( prop )
                return Property_CreatePyObject( prop );
 
@@ -3004,7 +3018,7 @@ static PyObject *Object_addProperty( BPy_Object * self, PyObject * args )
        char *prop_type = NULL;
        short type = -1;
        BPy_Property *py_prop = NULL;
-       int argslen = PyObject_Length( args );
+       int argslen = PyTuple_Size( args );
 
        if( argslen == 3 || argslen == 2 ) {
                if( !PyArg_ParseTuple( args, "sO|s", &prop_name, &prop_data,
@@ -3115,7 +3129,7 @@ static PyObject *Object_removeProperty( BPy_Object * self, PyObject * args )
                        py_prop->property = NULL;
                }
        } else {
-               prop = get_property( self->object, prop_name );
+               prop = get_ob_property( self->object, prop_name );
                if( prop ) {
                        BLI_remlink( &self->object->prop, prop );
                        free_property( prop );
@@ -3134,18 +3148,23 @@ static PyObject *Object_copyAllPropertiesTo( BPy_Object * self,
                                             PyObject * args )
 {
        PyObject *dest;
+       Object *dest_ob;
        bProperty *prop = NULL;
        bProperty *propn = NULL;
 
        if( !PyArg_ParseTuple( args, "O!", &Object_Type, &dest ) )
                return EXPP_ReturnPyObjError( PyExc_TypeError,
                                "expected an Object" );
-
+       
+       if (dest == (PyObject *)self) {
+               Py_RETURN_NONE;
+       }
+       dest_ob = ( ( BPy_Object * ) dest )->object;
+       
        /*make a copy of all its properties*/
        prop = self->object->prop.first;
        while( prop ) {
-               propn = copy_property( prop );
-               BLI_addtail( &( ( BPy_Object * ) dest )->object->prop, propn );
+               set_ob_property( dest_ob, prop );
                prop = prop->next;
        }
 
@@ -3305,6 +3324,33 @@ static PyObject *Object_insertShapeKey(BPy_Object * self)
        Py_RETURN_NONE;
 }
 
+static PyObject *Object_getColor( BPy_Object *self, void *type )
+{
+       return Py_BuildValue( "(ffff)", self->object->col[0], self->object->col[1], self->object->col[2], self->object->col[3] );
+}
+
+static int Object_setColor( BPy_Object *self, PyObject *value )
+{
+       int i;
+       float color[4];
+       struct Object *object = self->object;
+
+       value = PySequence_Tuple( value );
+
+       if( !value || !PyArg_ParseTuple( value, "ffff", &color[0], &color[1], &color[2], &color[3] ) ) {
+               Py_XDECREF( value );
+               return EXPP_ReturnIntError( PyExc_TypeError,
+                                       "expected a list or tuple of 3 floats" );
+       }
+
+       Py_DECREF( value );
+       
+       for( i = 0; i < 4; ++i ) {
+               object->col[i] = MAX2(MIN2(color[i], 1.0), 0);
+       }
+       return 0;
+}
+
 /* __copy__() */
 static  PyObject *Object_copy(BPy_Object * self)
 {
@@ -5189,7 +5235,10 @@ static PyGetSetDef BPy_Object_getseters[] = {
         (getter)Object_getDrawModeBits, (setter)Object_setDrawModeBits,
         "Transparent materials for the active object (mesh only) enabled",
         (void *)OB_DRAWTRANSP},
-
+       {"color",
+        (getter)Object_getColor, (setter)Object_setColor,
+        "Object color used by the game engine and optionally for materials",
+        NULL},
        {"enableNLAOverride",
         (getter)Object_getNLAflagBits, (setter)Object_setNLAflagBits,
         "Toggles Action-NLA based animation",
index 52ede1cb3eec09de33501b93427413c95582c8c2..06d736f2cb61e1cf5a739433da71a7412508ad09 100644 (file)
@@ -414,16 +414,17 @@ static PyObject *PoseBone_insertKey(BPy_PoseBone *self, PyObject *args)
 {
        PyObject *parent_object = NULL;
        PyObject *constants = NULL, *item = NULL;
-       int frame = 1, oldframe, length, x, numeric_value = 0, oldflag, no_ipo_update = 0;
+       int frame = 1, oldframe, length, x, numeric_value = 0, oldflag, no_ipo_update = 0, flag = 0;
        bPoseChannel *pchan = NULL;
        
 
        if (!PyArg_ParseTuple(args, "O!i|Oi", &Object_Type, &parent_object, &frame, &constants, &no_ipo_update ))
                goto AttributeError;
        
-       /* incase we ever have a value other then 1 for fast */
-       if (no_ipo_update)
-               no_ipo_update = 1;
+       /* flag should be initialised with the 'autokeying' flags like for normal keying */
+       if (no_ipo_update) flag |= INSERTKEY_FAST;
+       if (IS_AUTOKEY_FLAG(AUTOMATKEY)) flag |= INSERTKEY_MATRIX;
+       if (IS_AUTOKEY_FLAG(INSERTNEEDED)) flag |= INSERTKEY_NEEDED;
        
        //verify that this pchannel is part of the object->pose
        for (pchan = ((BPy_Object*)parent_object)->object->pose->chanbase.first; 
@@ -493,29 +494,29 @@ static PyObject *PoseBone_insertKey(BPy_PoseBone *self, PyObject *args)
        //insert the pose keys
        if (self->posechannel->flag & POSE_ROT){
                insertkey(&((BPy_Object*)parent_object)->object->id, 
-                       ID_PO, self->posechannel->name, NULL, AC_QUAT_X, no_ipo_update);
+                       ID_PO, self->posechannel->name, NULL, AC_QUAT_X, flag);
                insertkey(&((BPy_Object*)parent_object)->object->id, 
-                       ID_PO, self->posechannel->name, NULL, AC_QUAT_Y, no_ipo_update);
+                       ID_PO, self->posechannel->name, NULL, AC_QUAT_Y, flag);
                insertkey(&((BPy_Object*)parent_object)->object->id, 
-                       ID_PO, self->posechannel->name, NULL, AC_QUAT_Z, no_ipo_update);
+                       ID_PO, self->posechannel->name, NULL, AC_QUAT_Z, flag);
                insertkey(&((BPy_Object*)parent_object)->object->id, 
-                       ID_PO, self->posechannel->name, NULL, AC_QUAT_W, no_ipo_update);
+                       ID_PO, self->posechannel->name, NULL, AC_QUAT_W, flag);
        }
        if (self->posechannel->flag & POSE_LOC){
                insertkey(&((BPy_Object*)parent_object)->object->id, 
-                       ID_PO, self->posechannel->name, NULL, AC_LOC_X, no_ipo_update);
+                       ID_PO, self->posechannel->name, NULL, AC_LOC_X, flag);
                insertkey(&((BPy_Object*)parent_object)->object->id, 
-                       ID_PO, self->posechannel->name, NULL, AC_LOC_Y, no_ipo_update);
+                       ID_PO, self->posechannel->name, NULL, AC_LOC_Y, flag);
                insertkey(&((BPy_Object*)parent_object)->object->id, 
-                       ID_PO, self->posechannel->name, NULL, AC_LOC_Z, no_ipo_update);
+                       ID_PO, self->posechannel->name, NULL, AC_LOC_Z, flag);
        }
        if (self->posechannel->flag & POSE_SIZE){
                insertkey(&((BPy_Object*)parent_object)->object->id, 
-                       ID_PO, self->posechannel->name, NULL, AC_SIZE_X, no_ipo_update);
+                       ID_PO, self->posechannel->name, NULL, AC_SIZE_X, flag);
                insertkey(&((BPy_Object*)parent_object)->object->id, 
-                       ID_PO, self->posechannel->name, NULL, AC_SIZE_Y, no_ipo_update);
+                       ID_PO, self->posechannel->name, NULL, AC_SIZE_Y, flag);
                insertkey(&((BPy_Object*)parent_object)->object->id, 
-                       ID_PO, self->posechannel->name, NULL, AC_SIZE_Z, no_ipo_update);
+                       ID_PO, self->posechannel->name, NULL, AC_SIZE_Z, flag);
        }
 
        //flip the frame back
index eba951b88133b434ce0946e226fba18ae65ea9bb..662656663c18e5f259a08d0279cbde135d03d1f8 100644 (file)
@@ -641,20 +641,18 @@ static PyObject *M_Scene_Get( PyObject * self, PyObject * args )
        if( !PyArg_ParseTuple( args, "|s", &name ) )
                return ( EXPP_ReturnPyObjError( PyExc_TypeError,
                                                "expected string argument (or nothing)" ) );
-
+       
        scene_iter = G.main->scene.first;
 
        if( name ) {            /* (name) - Search scene by name */
 
                PyObject *wanted_scene = NULL;
 
-               while( ( scene_iter ) && ( wanted_scene == NULL ) ) {
-
-                       if( strcmp( name, scene_iter->id.name + 2 ) == 0 )
-                               wanted_scene =
-                                       Scene_CreatePyObject( scene_iter );
-
-                       scene_iter = scene_iter->id.next;
+               for(;scene_iter; scene_iter = scene_iter->id.next) {
+                       if( strcmp( name, scene_iter->id.name + 2 ) == 0 ) {
+                               wanted_scene = Scene_CreatePyObject( scene_iter );
+                               break;
+                       }
                }
 
                if( wanted_scene == NULL ) {    /* Requested scene doesn't exist */
@@ -678,19 +676,14 @@ static PyObject *M_Scene_Get( PyObject * self, PyObject * args )
                        return ( EXPP_ReturnPyObjError( PyExc_MemoryError,
                                                        "couldn't create PyList" ) );
 
-               while( scene_iter ) {
+               for(; scene_iter; scene_iter = scene_iter->id.next, index++) {
                        pyobj = Scene_CreatePyObject( scene_iter );
 
                        if( !pyobj ) {
                                Py_DECREF(sce_pylist);
-                               return ( EXPP_ReturnPyObjError
-                                        ( PyExc_MemoryError,
-                                          "couldn't create PyString" ) );
+                               return NULL; /* Scene_CreatePyObject sets an error */
                        }
                        PyList_SET_ITEM( sce_pylist, index, pyobj );
-
-                       scene_iter = scene_iter->id.next;
-                       index++;
                }
 
                return sce_pylist;
index 9719daaa3d4c9d288d12b63e1d5e419a1b5ab0cb..c8b96fbd97e739ad89e8c74d3a9749bafc07edad 100644 (file)
 
 #define EXPP_TEXT_MODE_FOLLOW TXT_FOLLOW
 
+/* checks for the group being removed */
+#define TEXT_DEL_CHECK_PY(bpy_text) if (!(bpy_text->text)) return ( EXPP_ReturnPyObjError( PyExc_RuntimeError, "Text has been removed" ) )
+#define TEXT_DEL_CHECK_INT(bpy_text) if (!(bpy_text->text)) return ( EXPP_ReturnIntError( PyExc_RuntimeError, "Text has been removed" ) )
+
 /*****************************************************************************/
 /* Python API function prototypes for the Text module.                       */
 /*****************************************************************************/
@@ -109,6 +113,8 @@ static PyObject *Text_markSelection( BPy_Text * self, PyObject * args );
 static PyObject *Text_suggest( BPy_Text * self, PyObject * args );
 static PyObject *Text_showDocs( BPy_Text * self, PyObject * args );
 
+static void text_reset_internal( BPy_Text * self ); /* internal func */
+
 /*****************************************************************************/
 /* Python BPy_Text methods table:                                            */
 /*****************************************************************************/
@@ -377,8 +383,7 @@ PyObject *Text_CreatePyObject( Text * txt )
                                              "couldn't create BPy_Text PyObject" );
 
        pytxt->text = txt;
-       pytxt->iol = NULL;
-       pytxt->ioc = -1;
+       text_reset_internal(pytxt);
 
        return ( PyObject * ) pytxt;
 }
@@ -388,6 +393,7 @@ PyObject *Text_CreatePyObject( Text * txt )
 /*****************************************************************************/
 static PyObject *Text_getFilename( BPy_Text * self )
 {
+       TEXT_DEL_CHECK_PY(self);
        if( self->text->name )
                return PyString_FromString( self->text->name );
        
@@ -398,7 +404,9 @@ static PyObject *Text_getNLines( BPy_Text * self )
 {                              /* text->nlines isn't updated in Blender (?) */
        int nlines = 0;
        TextLine *line;
-
+       
+       TEXT_DEL_CHECK_PY(self);
+       
        line = self->text->lines.first;
 
        while( line ) {         /* so we have to count them ourselves */
@@ -415,9 +423,7 @@ static PyObject *Text_clear( BPy_Text * self)
 {
        int oldstate;
 
-       if( !self->text )
-               return EXPP_ReturnPyObjError( PyExc_RuntimeError,
-                                             "This object isn't linked to a Blender Text Object" );
+       TEXT_DEL_CHECK_PY(self);
 
        oldstate = txt_get_undostate(  );
        txt_set_undostate( 1 );
@@ -428,11 +434,15 @@ static PyObject *Text_clear( BPy_Text * self)
        Py_RETURN_NONE;
 }
 
-static PyObject *Text_reset( BPy_Text * self )
+static void text_reset_internal( BPy_Text * self )
 {
        self->iol = NULL;
        self->ioc = -1;
+}
 
+static PyObject *Text_reset( BPy_Text * self )
+{
+       text_reset_internal(self);
        Py_RETURN_NONE;
 }
 
@@ -440,9 +450,7 @@ static PyObject *Text_readline( BPy_Text * self )
 {
        PyObject *tmpstr;
        
-       if( !self->text )
-               return EXPP_ReturnPyObjError( PyExc_RuntimeError,
-                                             "This object isn't linked to a Blender Text Object" );
+       TEXT_DEL_CHECK_PY(self);
 
        /* Reset */
        if (!self->iol && self->ioc == -1) {
@@ -476,20 +484,18 @@ static PyObject *Text_write( BPy_Text * self, PyObject * value )
        char *str = PyString_AsString(value);
        int oldstate;
 
-       if( !self->text )
-               return EXPP_ReturnPyObjError( PyExc_RuntimeError,
-                                             "This object isn't linked to a Blender Text Object" );
-
        if( !str )
                return EXPP_ReturnPyObjError( PyExc_TypeError,
                                              "expected string argument" );
 
+       TEXT_DEL_CHECK_PY(self);
+       
        oldstate = txt_get_undostate(  );
        txt_insert_buf( self->text, str );
        txt_move_eof( self->text, 0 );
        txt_set_undostate( oldstate );
 
-       Text_reset( self );
+       text_reset_internal( self );
 
        Py_RETURN_NONE;
 }
@@ -499,19 +505,17 @@ static PyObject *Text_insert( BPy_Text * self, PyObject * value )
        char *str = PyString_AsString(value);
        int oldstate;
 
-       if( !self->text )
-               return EXPP_ReturnPyObjError( PyExc_RuntimeError,
-                                             "This object isn't linked to a Blender Text Object" );
-
        if( !str )
                return EXPP_ReturnPyObjError( PyExc_TypeError,
                                              "expected string argument" );
+       
+       TEXT_DEL_CHECK_PY(self);
 
        oldstate = txt_get_undostate(  );
        txt_insert_buf( self->text, str );
        txt_set_undostate( oldstate );
 
-       Text_reset( self );
+       text_reset_internal( self );
 
        Py_RETURN_NONE;
 }
@@ -521,11 +525,10 @@ static PyObject *Text_delete( BPy_Text * self, PyObject * value )
        int num = PyInt_AsLong(value);
        int oldstate;
 
-       if( !self->text )
-               return EXPP_ReturnPyObjError( PyExc_RuntimeError,
-                                             "This object isn't linked to a Blender Text Object" );
-
-       if( !num )
+       TEXT_DEL_CHECK_PY(self);
+       
+       /* zero num is invalid and -1 is an error value */
+       if( !num || (num==-1 && PyErr_Occurred()))
                return EXPP_ReturnPyObjError( PyExc_TypeError,
                                              "expected non-zero int argument" );
 
@@ -540,7 +543,7 @@ static PyObject *Text_delete( BPy_Text * self, PyObject * value )
        }
        txt_set_undostate( oldstate );
        
-       Text_reset( self );
+       text_reset_internal( self );
 
        Py_RETURN_NONE;
 }
@@ -550,6 +553,8 @@ static PyObject *Text_set( BPy_Text * self, PyObject * args )
        int ival;
        char *attr;
 
+       TEXT_DEL_CHECK_PY(self);
+       
        if( !PyArg_ParseTuple( args, "si", &attr, &ival ) )
                return EXPP_ReturnPyObjError( PyExc_TypeError,
                                              "expected a string and an int as arguments" );
@@ -570,9 +575,7 @@ static PyObject *Text_asLines( BPy_Text * self, PyObject * args )
        PyObject *list, *tmpstr;
        int start=0, end=-1, i;
 
-       if( !self->text )
-               return EXPP_ReturnPyObjError( PyExc_RuntimeError,
-                                             "This object isn't linked to a Blender Text Object" );
+       TEXT_DEL_CHECK_PY(self);
 
        if( !PyArg_ParseTuple( args, "|ii", &start, &end ) )
                        return EXPP_ReturnPyObjError( PyExc_TypeError,
@@ -608,10 +611,9 @@ static PyObject *Text_getCursorPos( BPy_Text * self )
        TextLine *linep;
        int row, col;
 
+       TEXT_DEL_CHECK_PY(self);
+       
        text = self->text;
-       if( !text )
-               return EXPP_ReturnPyObjError( PyExc_RuntimeError,
-                                             "This object isn't linked to a Blender Text Object" );
 
        for (row=0,linep=text->lines.first; linep!=text->curl; linep=linep->next)
                row++;
@@ -625,9 +627,7 @@ static PyObject *Text_setCursorPos( BPy_Text * self, PyObject * args )
        int row, col;
        SpaceText *st;
 
-       if (!self->text)
-               return EXPP_ReturnPyObjError(PyExc_RuntimeError,
-                                             "This object isn't linked to a Blender Text Object");
+       TEXT_DEL_CHECK_PY(self);
 
        if (!PyArg_ParseTuple(args, "ii", &row, &col))
                return EXPP_ReturnPyObjError(PyExc_TypeError,
@@ -649,10 +649,9 @@ static PyObject *Text_getSelectPos( BPy_Text * self )
        TextLine *linep;
        int row, col;
 
+       TEXT_DEL_CHECK_PY(self);
+       
        text = self->text;
-       if( !text )
-               return EXPP_ReturnPyObjError( PyExc_RuntimeError,
-                                             "This object isn't linked to a Blender Text Object" );
 
        for (row=0,linep=text->lines.first; linep!=text->sell; linep=linep->next)
                row++;
@@ -666,9 +665,7 @@ static PyObject *Text_setSelectPos( BPy_Text * self, PyObject * args )
        int row, col;
        SpaceText *st;
 
-       if (!self->text)
-               return EXPP_ReturnPyObjError(PyExc_RuntimeError,
-                                             "This object isn't linked to a Blender Text Object");
+       TEXT_DEL_CHECK_PY(self);
 
        if (!PyArg_ParseTuple(args, "ii", &row, &col))
                return EXPP_ReturnPyObjError(PyExc_TypeError,
@@ -690,10 +687,9 @@ static PyObject *Text_markSelection( BPy_Text * self, PyObject * args )
        Text *text;
        char color[4];
 
+       TEXT_DEL_CHECK_PY(self);
+       
        text = self->text;
-       if (!text)
-               return EXPP_ReturnPyObjError(PyExc_RuntimeError,
-                                             "This object isn't linked to a Blender Text Object");
 
        if (!PyArg_ParseTuple(args, "i(iii)i", &group, &r, &g, &b, &flags))
                return EXPP_ReturnPyObjError(PyExc_TypeError,
@@ -723,9 +719,7 @@ static PyObject *Text_suggest( BPy_Text * self, PyObject * args )
        char *prefix = NULL, *name, type;
        SpaceText *st;
 
-       if (!self->text)
-               return EXPP_ReturnPyObjError(PyExc_RuntimeError,
-                               "This object isn't linked to a Blender Text Object");
+       TEXT_DEL_CHECK_PY(self);
 
        /* Parse args for a list of strings/tuples */
        if (!PyArg_ParseTuple(args, "O!|s", &PyList_Type, &list, &prefix))
@@ -782,10 +776,8 @@ static PyObject *Text_showDocs( BPy_Text * self, PyObject * args )
 {
        char *docs;
        SpaceText *st;
-
-       if (!self->text)
-               return EXPP_ReturnPyObjError(PyExc_RuntimeError,
-                               "This object isn't linked to a Blender Text Object");
+       
+       TEXT_DEL_CHECK_PY(self);
 
        if (!PyArg_ParseTuple(args, "s", &docs))
                return EXPP_ReturnPyObjError( PyExc_TypeError,
@@ -839,6 +831,7 @@ static PyObject *Text_repr( BPy_Text * self )
 /*****************************************************************************/
 static PyObject *Text_getMode(BPy_Text * self)
 {
+       TEXT_DEL_CHECK_PY(self);
        return PyInt_FromLong( self->text->flags );
 }
 
index 0c57488a2664cb629e551cde0f5cd69cece7c59a..354d8cda0b79dfa5be28be51f78291de89cb1491 100644 (file)
@@ -43,6 +43,7 @@
 #include "World.h"  /*This must come first*/
 
 #include "DNA_scene_types.h"  /* for G.scene */
+#include "DNA_userdef_types.h"
 #include "BKE_global.h"
 #include "BKE_world.h"
 #include "BKE_main.h"
@@ -988,7 +989,7 @@ World *World_FromPyObject( PyObject * py_obj )
 
 static PyObject *World_insertIpoKey( BPy_World * self, PyObject * args )
 {
-       int key = 0, map;
+       int key = 0, flag = 0, map;
 
        if( !PyArg_ParseTuple( args, "i", &( key ) ) )
                return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
@@ -996,38 +997,41 @@ static PyObject *World_insertIpoKey( BPy_World * self, PyObject * args )
 
        map = texchannel_to_adrcode(self->world->texact);
 
+       /* flag should be initialised with the 'autokeying' flags like for normal keying */
+       if (IS_AUTOKEY_FLAG(INSERTNEEDED)) flag |= INSERTKEY_NEEDED;
+       
        if(key == IPOKEY_ZENITH) {
-               insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_ZEN_R, 0);
-               insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_ZEN_G, 0);
-               insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_ZEN_B, 0);
+               insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_ZEN_R, flag);
+               insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_ZEN_G, flag);
+               insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_ZEN_B, flag);
        }
        if(key == IPOKEY_HORIZON) {
-               insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_HOR_R, 0);
-               insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_HOR_G, 0);
-               insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_HOR_B, 0);
+               insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_HOR_R, flag);
+               insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_HOR_G, flag);
+               insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_HOR_B, flag);
        }
        if(key == IPOKEY_MIST) {
-               insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_MISI, 0);
-               insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_MISTDI, 0);
-               insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_MISTSTA, 0);
-               insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_MISTHI, 0);
+               insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_MISI, flag);
+               insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_MISTDI, flag);
+               insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_MISTSTA, flag);
+               insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_MISTHI, flag);
        }
        if(key == IPOKEY_STARS) {
-               insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_STAR_R, 0);
-               insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_STAR_G, 0);
-               insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_STAR_B, 0);
-               insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_STARDIST, 0);
-               insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_STARSIZE, 0);
+               insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_STAR_R, flag);
+               insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_STAR_G, flag);
+               insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_STAR_B, flag);
+               insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_STARDIST, flag);
+               insertkey((ID *)self->world, ID_WO, NULL, NULL, WO_STARSIZE, flag);
        }
        if(key == IPOKEY_OFFSET) {
-               insertkey((ID *)self->world, ID_WO, NULL, NULL, map+MAP_OFS_X, 0);
-               insertkey((ID *)self->world, ID_WO, NULL, NULL, map+MAP_OFS_Y, 0);
-               insertkey((ID *)self->world, ID_WO, NULL, NULL, map+MAP_OFS_Z, 0);
+               insertkey((ID *)self->world, ID_WO, NULL, NULL, map+MAP_OFS_X, flag);
+               insertkey((ID *)self->world, ID_WO, NULL, NULL, map+MAP_OFS_Y, flag);
+               insertkey((ID *)self->world, ID_WO, NULL, NULL, map+MAP_OFS_Z, flag);
        }
        if(key == IPOKEY_SIZE) {
-               insertkey((ID *)self->world, ID_WO, NULL, NULL, map+MAP_SIZE_X, 0);
-               insertkey((ID *)self->world, ID_WO, NULL, NULL, map+MAP_SIZE_Y, 0);
-               insertkey((ID *)self->world, ID_WO, NULL, NULL, map+MAP_SIZE_Z, 0);
+               insertkey((ID *)self->world, ID_WO, NULL, NULL, map+MAP_SIZE_X, flag);
+               insertkey((ID *)self->world, ID_WO, NULL, NULL, map+MAP_SIZE_Y, flag);
+               insertkey((ID *)self->world, ID_WO, NULL, NULL, map+MAP_SIZE_Z, flag);
        }
 
        allspace(REMAKEIPO, 0);
index 2960d8ed1d25d0d0dea19da2ddcf0fd3c99e0df1..192c9710ea28c30f9a63449ae36a96852150b718 100644 (file)
@@ -61,6 +61,14 @@ The Blender Python API Reference
                - L{World}
                - L{sys<Sys>}
 
+       Additional information:
+       -----------------------
+               - L{API_related}:
+                       - Calling scripts from command line
+                       - Script links and space handlers
+                       - How to register scripts in menus
+                       - Recommended ways to document and support configuration options
+
 Introduction:
 =============
 
index 4e29f95e76de0611800ebb7b1cb5e1a93e16871d..dcd2bdd1e603a92d4594a2a3e85af0a8ce1d2618 100644 (file)
@@ -226,6 +226,7 @@ Introduction:
   import Blender
   from Blender import Draw
   evt = Blender.event
+  val = Blender.eventValue
   return_it = False
 
   if evt == Draw.LEFTMOUSE:
@@ -233,7 +234,7 @@ Introduction:
   elif evt == Draw.AKEY:
     print "Swallowing an 'a' character"
   else:
-    print "Let the 3D View itself process this event:", evt
+    print "Let the 3D View itself process this event: %d with value %d" % (evt, val)
     return_it = True
 
   # if Blender should not process itself the passed event:
@@ -249,8 +250,14 @@ Introduction:
     tells what space this handler belongs to and the handler's type
     (EVENT, DRAW);
   - B{event}:
-     - EVENT handlers: an input event (check keys and mouse events in L{Draw})
-       to be processed or ignored.
+     - EVENT handlers: an input event (check keys and mouse events in
+       L{Draw}) to be processed or ignored;
+     - DRAW handlers: 0 always;
+  - B{eventValue}:
+     - EVENT handlers: the event value, it indicates mouse button or key
+       presses (since we don't pass releases) as 1 and mouse movements
+       (Draw.MOUSE.X and Draw.MOUSE.Y) as the current x or y coordinate,
+       for example;
      - DRAW handlers: 0 always.
 
  B{Guidelines (important)}:
index 964b8f70e8bb18a5d42fc6a459db73deef201342..9d89cae713770ce9c3228a5b7f200b92756b6ccc 100644 (file)
@@ -10,8 +10,8 @@
 """
 The main Blender module.
 
-B{New}: L{Run}, L{UpdateMenus}, new options to L{Get}, L{ShowHelp},
-L{SpaceHandlers} dictionary.
+B{New}: new var L{eventValue} for space handlers, L{Run}, L{UpdateMenus},
+new options to L{Get}, L{ShowHelp}, L{SpaceHandlers} dictionary.
 L{UnpackModes} dictionary.
 
 Blender
@@ -34,7 +34,11 @@ Blender
       - for normal L{GUI<Draw.Register>} scripts I{during the events callback},
         it holds the ascii value of the current event, if it is a valid one.
         Users interested in this should also check the builtin 'ord' and 'chr'
-        Python functions. 
+        Python functions.
+@type eventValue: int
+@var eventValue: used only for EVENT space handlers, it holds the event value:
+      - for mouse button and key presses it's 1, for mouse movement
+        (Draw.MOUSEX and Draw.MOUSEY) it has the new x or y coordinate, resp.
 @type mode: string
 @var mode: Blender's current mode:
     - 'interactive': normal mode, with an open window answering to user input;
index 07942d580937c46b0954fa14fd8a2f6333160812..49cb14d1e664d5ce9b9ecaf9d384e6432d72d03f 100644 (file)
@@ -552,6 +552,8 @@ class Object:
        @ivar transp: Enable transparent materials for the active object
                (mesh only).  Also see B{TRANSP} bit in L{drawMode} attribute.
        @type transp: boolean
+       @ivar color: Object color used by the game engine and optionally for materials, 4 floats for RGBA object color.
+       @type color: tuple of 4 floats between 0 and 1
        @ivar drawMode: The object's drawing mode bitfield.
                See L{DrawModes} constant dict for values.
        @type drawMode: int
index 22e165cbe9fc96b31bb3d909bd6f738d73d99ecc..7f88acd3a87e50c969fed4a37fdabf8808fc1dd6 100644 (file)
@@ -481,7 +481,6 @@ PyObject *RenderData_Render( BPy_RenderData * self )
                set_scene( oldsce );
        }
        else { /* background mode (blender -b file.blend -P script) */
-               int slink_flag = 0;
                Render *re= RE_NewRender(G.scene->id.name);
 
                int end_frame = G.scene->r.efra;
@@ -492,20 +491,14 @@ PyObject *RenderData_Render( BPy_RenderData * self )
 
                G.scene->r.efra = G.scene->r.sfra;
 
-               if (G.f & G_DOSCRIPTLINKS) {
-                       BPY_do_all_scripts(SCRIPT_RENDER);
-                       G.f &= ~G_DOSCRIPTLINKS; /* avoid FRAMECHANGED events*/
-                       slink_flag = 1;
-               }
+               if (G.f & G_DOSCRIPTLINKS)
+                       BPY_do_all_scripts(SCRIPT_RENDER, 0);
 
                tstate = PyEval_SaveThread();
 
-               RE_BlenderAnim(re, G.scene, G.scene->r.sfra, G.scene->r.efra);
+               RE_BlenderAnim(re, G.scene, G.scene->r.sfra, G.scene->r.efra, G.scene->frame_step);
 
-               if (slink_flag) {
-                       G.f |= G_DOSCRIPTLINKS;
-                       BPY_do_all_scripts(SCRIPT_POSTRENDER);
-               }
+               BPY_do_all_scripts(SCRIPT_POSTRENDER, 0);
 
                G.scene->r.efra = end_frame;
        }
@@ -603,13 +596,13 @@ PyObject *RenderData_RenderAnim( BPy_RenderData * self )
                                "start frame must be less or equal to end frame");
 
                if (G.f & G_DOSCRIPTLINKS)
-                       BPY_do_all_scripts(SCRIPT_RENDER);
+                       BPY_do_all_scripts(SCRIPT_RENDER, 1);
 
                tstate = PyEval_SaveThread();
-               RE_BlenderAnim(re, G.scene, G.scene->r.sfra, G.scene->r.efra);
+               RE_BlenderAnim(re, G.scene, G.scene->r.sfra, G.scene->r.efra, G.scene->frame_step);
 
                if (G.f & G_DOSCRIPTLINKS)
-                       BPY_do_all_scripts(SCRIPT_POSTRENDER);
+                       BPY_do_all_scripts(SCRIPT_POSTRENDER, 1);
        }
 
        PyEval_RestoreThread(tstate);
index 64cf7fcb37b0f8e5f8c1482c5de928525ff2c6d6..60557403143e3354e3a2cd981f80ca4a83668762 100644 (file)
@@ -185,7 +185,7 @@ void RE_TileProcessor(struct Render *re, int firsttile, int threaded);
 
 /* only RE_NewRender() needed, main Blender render calls */
 void RE_BlenderFrame(struct Render *re, struct Scene *scene, int frame);
-void RE_BlenderAnim(struct Render *re, struct Scene *scene, int sfra, int efra);
+void RE_BlenderAnim(struct Render *re, struct Scene *scene, int sfra, int efra, int tfra);
 
 void RE_ReadRenderResult(struct Scene *scene, struct Scene *scenode);
 void RE_WriteRenderResult(RenderResult *rr, char *filename, int compress);
index 7e2194549cc9274264f0ed56fc4e9792f31e2c0f..1768b052b54fc431458613d077bdbfecb0cb9f9b 100644 (file)
@@ -421,6 +421,7 @@ typedef struct LampRen {
        short type;
        int mode;
        float r, g, b, k;
+       float shdwr, shdwg, shdwb;
        float energy, haint;
        int lay;
        float spotsi,spotbl;
index 8e56c4a852fe54142c323902cc7623d23d03ba6c..be5471e07c4d451a5b6ce0ce31d34697c0393a8d 100644 (file)
@@ -55,7 +55,7 @@ struct ImBuf;
 void do_halo_tex(struct HaloRen *har, float xn, float yn, float *colf);
 void do_sky_tex(float *rco, float *lo, float *dxyview, float *hor, float *zen, float *blend, int skyflag);
 void do_material_tex(struct ShadeInput *shi);
-void do_lamp_tex(LampRen *la, float *lavec, struct ShadeInput *shi, float *colf);
+void do_lamp_tex(LampRen *la, float *lavec, struct ShadeInput *shi, float *colf, int effect);
 
 void init_render_textures(Render *re);
 
index 33f32a4744e306fb4d41e553a2a1d6fa3d9a0ea7..d5ac2fa17480fa56069c6d9e37ffc093a53383fe 100644 (file)
@@ -3456,6 +3456,9 @@ static GroupObject *add_render_lamp(Render *re, Object *ob)
        lar->r= lar->energy*la->r;
        lar->g= lar->energy*la->g;
        lar->b= lar->energy*la->b;
+       lar->shdwr= la->shdwr;
+       lar->shdwg= la->shdwg;
+       lar->shdwb= la->shdwb;
        lar->k= la->k;
 
        // area
@@ -3608,7 +3611,10 @@ static GroupObject *add_render_lamp(Render *re, Object *ob)
 
        for(c=0; c<MAX_MTEX; c++) {
                if(la->mtex[c] && la->mtex[c]->tex) {
-                       lar->mode |= LA_TEXTURE;
+                       if (la->mtex[c]->mapto & LAMAP_COL) 
+                               lar->mode |= LA_TEXTURE;
+                       if (la->mtex[c]->mapto & LAMAP_SHAD)
+                               lar->mode |= LA_SHAD_TEX;
 
                        if(G.rendering) {
                                if(re->osa) {
index bf2a72b4f9b764b94dd91c802319479462ee3437..6bdd57612c7ccd34d23169627cce223f6e3d9ced 100644 (file)
@@ -38,6 +38,7 @@
 #include "DNA_scene_types.h"
 #include "DNA_userdef_types.h"
 
+#include "BKE_utildefines.h"
 #include "BKE_global.h"
 #include "BKE_image.h"
 #include "BKE_main.h"
@@ -961,7 +962,6 @@ void RE_GetResultImage(Render *re, RenderResult *rr)
        }
 }
 
-#define FTOCHAR(val) val<=0.0f?0: (val>=1.0f?255: (char)(255.0f*val))
 /* caller is responsible for allocating rect in correct size! */
 void RE_ResultGet32(Render *re, unsigned int *rect)
 {
@@ -2559,10 +2559,12 @@ static void do_write_image_or_movie(Render *re, Scene *scene, bMovieHandle *mh)
 }
 
 /* saves images to disk */
-void RE_BlenderAnim(Render *re, Scene *scene, int sfra, int efra)
+void RE_BlenderAnim(Render *re, Scene *scene, int sfra, int efra, int tfra)
 {
        bMovieHandle *mh= BKE_get_movie_handle(scene->r.imtype);
+       unsigned int lay;
        int cfrao= scene->r.cfra;
+       int nfra;
        
        /* do not fully call for each frame, it initializes & pops output window */
        if(!render_initialize_from_scene(re, scene, 0))
@@ -2591,12 +2593,27 @@ void RE_BlenderAnim(Render *re, Scene *scene, int sfra, int efra)
                        }
                }
        } else {
-               for(scene->r.cfra= sfra; scene->r.cfra<=efra; scene->r.cfra++) {
+               for(nfra= sfra, scene->r.cfra= sfra; scene->r.cfra<=efra; scene->r.cfra++) {
                        char name[FILE_MAX];
                        
                        /* only border now, todo: camera lens. (ton) */
                        render_initialize_from_scene(re, scene, 1);
-                       
+
+                       if(nfra!=scene->r.cfra) {
+                               /*
+                                * Skip this frame, but update for physics and particles system.
+                                * From convertblender.c:
+                                * in localview, lamps are using normal layers, objects only local bits.
+                                */
+                               if(scene->lay & 0xFF000000)
+                                       lay= scene->lay & 0xFF000000;
+                               else
+                                       lay= scene->lay;
+
+                               scene_update_for_newframe(scene, lay);
+                               continue;
+                       }
+
                        if (scene->r.mode & (R_NO_OVERWRITE | R_TOUCH) ) {
                                BKE_makepicstring(name, scene->r.pic, scene->r.cfra, scene->r.imtype);
                        }
@@ -2626,6 +2643,7 @@ void RE_BlenderAnim(Render *re, Scene *scene, int sfra, int efra)
                                
                                break;
                        }
+                       nfra+= tfra;
                }
        }
        
index 2e3509f0471b6aae0665763ed2d8b32caeea73d7..ef723eea6b5a137717454e7633c8fbe7fc3e8c11 100644 (file)
@@ -141,7 +141,7 @@ static void render_lighting_halo(HaloRen *har, float *colf)
                        
                        VECCOPY(shi.co, rco);
                        shi.osatex= 0;
-                       do_lamp_tex(lar, lv, &shi, lacol);
+                       do_lamp_tex(lar, lv, &shi, lacol, LA_TEXTURE);
                }
                
                if(lar->type==LA_SPOT) {
index bda02bea8d7a832c44d74c851a25ec570f21fe93..05ff0d3c02004977d9af1a6762e14d91d1592051 100644 (file)
@@ -672,22 +672,10 @@ static void atm_tile(RenderPart *pa, RenderLayer *rl)
        GroupObject *go;
        LampRen *lar;
        RenderLayer *rlpp[RE_MAX_OSA];
-
-       int totsample, fullsample, sample;
-       int x, y,od;
-       short first_lamp;
-       float *zrect;
-       float *rgbrect;
-       float rgb[3]={0};
-       float tmp_rgb[3];
-       float fac;
-       float facm;
+       int totsample;
+       int x, y, od= 0;
        
-       fac = 0.5;
-       facm = 1.0 - fac;
-
        totsample= get_sample_layers(pa, rl, rlpp);
-       fullsample= (totsample > 1);
 
        /* check that z pass is enabled */
        if(pa->rectz==NULL) return;
@@ -698,65 +686,66 @@ static void atm_tile(RenderPart *pa, RenderLayer *rl)
        if(zpass==NULL) return;
 
        /* check for at least one sun lamp that its atmosphere flag is is enabled */
-       first_lamp = 1;
        for(go=R.lights.first; go; go= go->next) {
                lar= go->lampren;
-               if(lar->type==LA_SUN && lar->sunsky && 
-                               (lar->sunsky->effect_type & LA_SUN_EFFECT_AP)){
-                       first_lamp = 0;
+               if(lar->type==LA_SUN && lar->sunsky && (lar->sunsky->effect_type & LA_SUN_EFFECT_AP))
                        break;
-               }
        }
        /* do nothign and return if there is no sun lamp */
-       if(first_lamp)
+       if(go==NULL)
                return;
        
-       zrect = zpass->rect;
-       rgbrect = rl->rectf;
-       od=0;
-       /* for each x,y and sun lamp*/
+       /* for each x,y and each sample, and each sun lamp*/
        for(y=pa->disprect.ymin; y<pa->disprect.ymax; y++) {
-               for(x=pa->disprect.xmin; x<pa->disprect.xmax; x++, zrect++, od++) {
+               for(x=pa->disprect.xmin; x<pa->disprect.xmax; x++, od++) {
+                       int sample;
                        
-                       first_lamp = 1;
-                       for(go=R.lights.first; go; go= go->next) {
-                               lar= go->lampren;
-                               if(lar->type==LA_SUN && lar->sunsky)
+                       for(sample=0; sample<totsample; sample++) {
+                               float *zrect= RE_RenderLayerGetPass(rlpp[sample], SCE_PASS_Z) + od;
+                               float *rgbrect = rlpp[sample]->rectf + 4*od;
+                               float rgb[3];
+                               int done= 0;
+                               
+                               for(go=R.lights.first; go; go= go->next) {
+                               
                                        
-                               {
-                                       /* if it's sky continue and don't apply atmosphere effect on it */
-                                       if(*zrect >= 9.9e10){
-                                               continue;
-                                       }
-
-                                       if(lar->sunsky->effect_type & LA_SUN_EFFECT_AP){        
-                                               VECCOPY(tmp_rgb, (float*)(rgbrect+4*od));
-
-                                               shadeAtmPixel(lar->sunsky, tmp_rgb, x, y, *zrect);
+                                       lar= go->lampren;
+                                       if(lar->type==LA_SUN && lar->sunsky) {
                                                
-                                               if(first_lamp){
-                                                       VECCOPY(rgb, tmp_rgb);
-                                                       first_lamp = 0;                                         
+                                               /* if it's sky continue and don't apply atmosphere effect on it */
+                                               if(*zrect >= 9.9e10 || rgbrect[3]==0.0f) {
+                                                       continue;
                                                }
-                                               else{
-                                                       rgb[0] = facm*rgb[0] + fac*tmp_rgb[0];
-                                                       rgb[1] = facm*rgb[1] + fac*tmp_rgb[1];
-                                                       rgb[2] = facm*rgb[2] + fac*tmp_rgb[2];
+                                               
+                                               if((lar->sunsky->effect_type & LA_SUN_EFFECT_AP)) {     
+                                                       float tmp_rgb[3];
+                                                       
+                                                       VECCOPY(tmp_rgb, rgbrect);
+                                                       if(rgbrect[3]!=1.0f) {  /* de-premul */
+                                                               float div= 1.0f/rgbrect[3];
+                                                               VECMUL(tmp_rgb, div);
+                                                       }
+                                                       shadeAtmPixel(lar->sunsky, tmp_rgb, x, y, *zrect);
+                                                       if(rgbrect[3]!=1.0f) {  /* premul */
+                                                               VECMUL(tmp_rgb, rgbrect[3]);
+                                                       }
+                                                       
+                                                       if(done==0) {
+                                                               VECCOPY(rgb, tmp_rgb);
+                                                               done = 1;                                               
+                                                       }
+                                                       else{
+                                                               rgb[0] = 0.5f*rgb[0] + 0.5f*tmp_rgb[0];
+                                                               rgb[1] = 0.5f*rgb[1] + 0.5f*tmp_rgb[1];
+                                                               rgb[2] = 0.5f*rgb[2] + 0.5f*tmp_rgb[2];
+                                                       }
                                                }
                                        }
                                }
-                       }
 
-                       /* if at least for one sun lamp aerial perspective was applied*/
-                       if(first_lamp==0)
-                       {
-                               if(fullsample) {
-                                       for(sample=0; sample<totsample; sample++) {
-                                               VECCOPY((float*)(rlpp[sample]->rectf + od*4), rgb);
-                                       }
-                               }
-                               else {
-                                       VECCOPY((float*)(rgbrect+4*od), rgb);
+                               /* if at least for one sun lamp aerial perspective was applied*/
+                               if(done) {
+                                       VECCOPY(rgbrect, rgb);
                                }
                        }
                }
@@ -1217,6 +1206,10 @@ void zbufshadeDA_tile(RenderPart *pa)
                        }
                }
 
+               /* sun/sky */
+               if(rl->layflag & SCE_LAY_SKY)
+                       atm_tile(pa, rl);
+               
                /* sky before edge */
                if(rl->layflag & SCE_LAY_SKY)
                        sky_tile(pa, rl);
@@ -1226,10 +1219,6 @@ void zbufshadeDA_tile(RenderPart *pa)
                        if(R.r.mode & R_EDGE) 
                                edge_enhance_add(pa, rl->rectf, edgerect);
                
-               /* sun/sky */
-               if(rl->layflag & SCE_LAY_SKY)
-                       atm_tile(pa, rl);
-
                if(rl->passflag & SCE_PASS_VECTOR)
                        reset_sky_speed(pa, rl);
                
@@ -1380,6 +1369,10 @@ void zbufshade_tile(RenderPart *pa)
                        }
                }
                
+               /* sun/sky */
+               if(rl->layflag & SCE_LAY_SKY)
+                       atm_tile(pa, rl);
+               
                /* sky before edge */
                if(rl->layflag & SCE_LAY_SKY)
                        sky_tile(pa, rl);
@@ -1390,10 +1383,6 @@ void zbufshade_tile(RenderPart *pa)
                                        edge_enhance_add(pa, rl->rectf, edgerect);
                }
                
-               /* sun/sky */
-               if(rl->layflag & SCE_LAY_SKY)
-                       atm_tile(pa, rl);
-                       
                if(rl->passflag & SCE_PASS_VECTOR)
                        reset_sky_speed(pa, rl);
                
@@ -1971,7 +1960,6 @@ void RE_shade_external(Render *re, ShadeInput *shi, ShadeResult *shr)
 
 /* ************************* bake ************************ */
 
-#define FTOCHAR(val) val<=0.0f?0: (val>=1.0f?255: (char)(255.0f*val))
 
 typedef struct BakeShade {
        ShadeSample ssamp;
index 5a80173d1f1118d2fa19adc88d2e591d2d7df6a8..91621c24365810de283276913798737948554f5a 100644 (file)
@@ -1179,7 +1179,7 @@ static void shade_one_light(LampRen *lar, ShadeInput *shi, ShadeResult *shr, int
 {
        Material *ma= shi->mat;
        VlakRen *vlr= shi->vlr;
-       float lv[3], lampdist, lacol[3], shadfac[4];
+       float lv[3], lampdist, lacol[3], shadfac[4], lashdw[3];
        float i, is, i_noshad, inp, *vn, *view, vnor[3], phongcorr=1.0f;
        float visifac;
        
@@ -1219,7 +1219,12 @@ static void shade_one_light(LampRen *lar, ShadeInput *shi, ShadeResult *shr, int
        lacol[1]= lar->g;
        lacol[2]= lar->b;
        
-       if(lar->mode & LA_TEXTURE)  do_lamp_tex(lar, lv, shi, lacol);
+       lashdw[0]= lar->shdwr;
+       lashdw[1]= lar->shdwg;
+       lashdw[2]= lar->shdwb;
+       
+       if(lar->mode & LA_TEXTURE)      do_lamp_tex(lar, lv, shi, lacol, LA_TEXTURE);
+       if(lar->mode & LA_SHAD_TEX)     do_lamp_tex(lar, lv, shi, lashdw, LA_SHAD_TEX);
 
                /* tangent case; calculate fake face normal, aligned with lampvector */ 
                /* note, vnor==vn is used as tangent trigger for buffer shadow */
@@ -1342,13 +1347,13 @@ static void shade_one_light(LampRen *lar, ShadeInput *shi, ShadeResult *shr, int
                                        if((lar->mode & LA_ONLYSHADOW) && i>0.0) {
                                                
                                                shadfac[3]= i*lar->energy*(1.0f-shadfac[3]);
-                                               shr->shad[0] -= shadfac[3]*shi->r;
-                                               shr->shad[1] -= shadfac[3]*shi->g;
-                                               shr->shad[2] -= shadfac[3]*shi->b;
+                                               shr->shad[0] -= shadfac[3]*shi->r*(1.0f-lashdw[0]);
+                                               shr->shad[1] -= shadfac[3]*shi->g*(1.0f-lashdw[1]);
+                                               shr->shad[2] -= shadfac[3]*shi->b*(1.0f-lashdw[2]);
                                                
-                                               shr->spec[0] -= shadfac[3]*shi->specr;
-                                               shr->spec[1] -= shadfac[3]*shi->specg;
-                                               shr->spec[2] -= shadfac[3]*shi->specb;
+                                               shr->spec[0] -= shadfac[3]*shi->specr*(1.0f-lashdw[0]);
+                                               shr->spec[1] -= shadfac[3]*shi->specg*(1.0f-lashdw[1]);
+                                               shr->spec[2] -= shadfac[3]*shi->specb*(1.0f-lashdw[2]);
                                                
                                                return;
                                        }
@@ -1366,6 +1371,10 @@ static void shade_one_light(LampRen *lar, ShadeInput *shi, ShadeResult *shr, int
                                else
                                        add_to_diffuse(shr->shad, shi, is, i*lacol[0], i*lacol[1], i*lacol[2]);
                        }
+                       /* add light for colored shadow */
+                       if (i_noshad>i && !(lashdw[0]==0 && lashdw[1]==0 && lashdw[2]==0)) {
+                               add_to_diffuse(shr->shad, shi, is, lashdw[0]*(i_noshad-i)*lacol[0], lashdw[1]*(i_noshad-i)*lacol[1], lashdw[2]*(i_noshad-i)*lacol[2]);
+                       }
                        if(i_noshad>0.0f) {
                                if(passflag & (SCE_PASS_DIFFUSE|SCE_PASS_SHADOW)) {
                                        if(ma->mode & MA_SHADOW_TRA)
index 27628d914653024ac64a3c6d43e830bf524a13dd..c14425e274fb75871ba115c46bb5c028e82a1cfa 100644 (file)
@@ -2301,7 +2301,7 @@ void do_sky_tex(float *rco, float *lo, float *dxyview, float *hor, float *zen, f
 /* ------------------------------------------------------------------------- */
 /* colf supposed to be initialized with la->r,g,b */
 
-void do_lamp_tex(LampRen *la, float *lavec, ShadeInput *shi, float *colf)
+void do_lamp_tex(LampRen *la, float *lavec, ShadeInput *shi, float *colf, int effect)
 {
        Object *ob;
        MTex *mtex;
@@ -2440,7 +2440,7 @@ void do_lamp_tex(LampRen *la, float *lavec, ShadeInput *shi, float *colf)
                        }
                        
                        /* mapping */
-                       if(mtex->mapto & LAMAP_COL) {
+                       if(((mtex->mapto & LAMAP_COL) && (effect & LA_TEXTURE))||((mtex->mapto & LAMAP_SHAD) && (effect & LA_SHAD_TEX))) {
                                float col[3];
                                
                                if(rgb==0) {
index c8c517e15ff10d999bc3f06d5b8b56e19d751a69..c421d1e83880353bc3eb45ecf967c7b76d96f645 100644 (file)
@@ -75,7 +75,13 @@ if env['WITH_BF_VERSE']:
 # TODO buildinfo
 if env['BF_BUILDINFO'] == 1:
     defs.append('NAN_BUILDINFO')
-       
+
+if env['BF_NO_ELBEEM'] == 1:
+    defs.append('DISABLE_ELBEEM')
+
+if env['WITH_BF_SDL'] == 0:
+    defs.append('DISABLE_SDL')
+
 if (env['BF_SPLIT_SRC'] == 1) and (env['OURPLATFORM'] == 'win32-mingw'):        
        for i in range(numlibs):         
                env.BlenderLib ( libname = 'src%d' % (i), sources = subsources[i], includes = Split(incs), defines = defs, libtype=['core', 'intern'], priority = [5, 25] )      
index e16443460a118aae92041b851965f9c704a04d5c..45974e5704c0a1afd31e75024fb33c9b3d7b8b51 100644 (file)
@@ -2969,6 +2969,45 @@ static void check_body_type(void *arg1_but, void *arg2_object)
        }
 }
 
+static uiBlock *advanced_bullet_menu(void *arg_ob)
+{
+       uiBlock *block;
+       Object *ob = arg_ob;
+       short yco = 65, xco = 0;
+
+       block= uiNewBlock(&curarea->uiblocks, "advanced_bullet_options", UI_EMBOSS, UI_HELV, curarea->win);
+       /* use this for a fake extra empy space around the buttons */
+       uiDefBut(block, LABEL, 0, "", -5, -10, 255, 100, NULL, 0, 0, 0, 0, "");
+
+       uiDefButBitI(block, TOG, OB_ACTOR, 0, "Sensor actor",
+                               xco, yco, 118, 19, &ob->gameflag, 0, 0, 0, 0,
+                               "Objects that are detected by the Near and Radar sensor");
+
+       if (ob->gameflag & OB_DYNAMIC) {
+               uiDefButBitI(block, TOG, OB_COLLISION_RESPONSE, 0, "No sleeping", 
+                                       xco+=120, yco, 118, 19, &ob->gameflag, 0, 0, 0, 0, 
+                                       "Disable auto (de)activation");
+       }
+
+       yco -= 25;
+       xco = 0;
+       if (ob->gameflag & OB_DYNAMIC) {
+               if (ob->margin < 0.001f)
+                       ob->margin = 0.06f;
+               uiDefButF(block, NUM, 0, "Margin", 
+                               xco, yco, 118, 19, &ob->margin, 0.001, 1.0, 1, 0, 
+                               "Collision margin");
+       } else {
+               uiDefButF(block, NUM, 0, "Margin", 
+                               xco, yco, 118, 19, &ob->margin, 0.0, 1.0, 1, 0, 
+                               "Collision margin");
+       }
+                       
+       uiBlockSetDirection(block, UI_TOP);
+
+       return block;
+}
+
 void buttons_bullet(uiBlock *block, Object *ob)
 {
        uiBut *but;
@@ -2976,7 +3015,7 @@ void buttons_bullet(uiBlock *block, Object *ob)
        /* determine the body_type setting based on flags */
        if (!(ob->gameflag & OB_COLLISION))
                ob->body_type = OB_BODY_TYPE_NO_COLLISION;
-       else if (!(ob->gameflag & OB_DYNAMIC) || !(ob->gameflag & OB_DYNAMIC))
+       else if (!(ob->gameflag & OB_DYNAMIC))
                ob->body_type = OB_BODY_TYPE_STATIC;
        else if (!(ob->gameflag & (OB_RIGID_BODY|OB_SOFT_BODY)))
                ob->body_type = OB_BODY_TYPE_DYNAMIC;
@@ -2985,61 +3024,51 @@ void buttons_bullet(uiBlock *block, Object *ob)
        else
                ob->body_type = OB_BODY_TYPE_SOFT;
 
-       uiBlockBeginAlign(block);
        but = uiDefButS(block, MENU, REDRAWVIEW3D, 
                        "Object type%t|No collision%x0|Static%x1|Dynamic%x2|Rigid body%x3|Soft body%x4", 
-                       10, 205, 150, 19, &ob->body_type, 0, 0, 0, 0, "Selects the type of physical representation of the object");
+                       10, 205, 120, 19, &ob->body_type, 0, 0, 0, 0, "Selects the type of physical representation");
        uiButSetFunc(but, check_body_type, but, ob);
 
        if (ob->gameflag & OB_COLLISION) {
-               but = uiDefButBitI(block, TOG, OB_ACTOR, B_REDR, "Actor",
-                               160,205,55,19, &ob->gameflag, 0, 0, 0, 0,
-                               "Objects that are detected by the Near and Radar sensor");
-               uiButSetFunc(but, check_actor, but, &ob->gameflag);
-               
-               uiDefButBitI(block, TOG, OB_GHOST, B_REDR, "Ghost", 215,205,55,19, 
+
+               uiBlockSetCol(block, TH_BUT_SETTING1);
+               uiDefBlockBut(block, advanced_bullet_menu, ob, 
+                                         "Advanced Settings", 
+                                         200, 205, 150, 20, "Display collision advanced settings");
+               uiBlockSetCol(block, TH_BUT_SETTING2);
+
+               uiBlockBeginAlign(block);
+               uiDefButBitI(block, TOG, OB_GHOST, 0, "Ghost", 10, 182, 60, 19, 
                                &ob->gameflag, 0, 0, 0, 0, 
                                "Objects that don't restitute collisions (like a ghost)");
+               if ((ob->gameflag & OB_DYNAMIC) || ((ob->gameflag & OB_BOUNDS) && (ob->boundtype == OB_BOUND_SPHERE))) {
+                       uiDefButF(block, NUM, REDRAWVIEW3D, "Radius:", 70, 182, 140, 19, 
+                                       &ob->inertia, 0.01, 10.0, 10, 2, 
+                                       "Bounding sphere radius, not used for other bounding shapes");
+               }
                if(ob->gameflag & OB_DYNAMIC) {
-                       uiDefButBitI(block, TOG, OB_COLLISION_RESPONSE, B_REDR, "No sleeping", 270,205,80,19, 
-                                       &ob->gameflag, 0, 0, 0, 0, 
-                                       "Disable auto (de)activation");
-                       uiDefButF(block, NUM, B_DIFF, "Mass:", 10, 185, 170, 19, 
+                       uiDefButF(block, NUM, B_DIFF, "Mass:", 210, 182, 140, 19, 
                                        &ob->mass, 0.01, 10000.0, 10, 2, 
                                        "The mass of the Object");
-                       uiDefButF(block, NUM, REDRAWVIEW3D, "Radius:", 180, 185, 170, 19, 
-                                       &ob->inertia, 0.01, 10.0, 10, 2, 
-                                       "Bounding sphere radius, not used for other bounding shapes");
 
-                       uiDefButF(block, NUMSLI, B_DIFF, "Damp ", 10, 165, 150, 19, 
+                       uiDefButF(block, NUMSLI, B_DIFF, "Damp ", 10, 162, 150, 19, 
                                        &ob->damping, 0.0, 1.0, 10, 0, 
                                        "General movement damping");
-                       uiDefButF(block, NUMSLI, B_DIFF, "RotDamp ", 160, 165, 190, 19, 
+                       uiDefButF(block, NUMSLI, B_DIFF, "RotDamp ", 160, 162, 190, 19, 
                                        &ob->rdamping, 0.0, 1.0, 10, 0, 
                                        "General rotation damping");
                }
                uiBlockEndAlign(block);
 
                uiBlockBeginAlign(block);
-               if ((ob->gameflag & (OB_ACTOR|OB_DYNAMIC)) == (OB_ACTOR|OB_DYNAMIC)) {
-                       if (ob->margin < 0.001f)
-                               ob->margin = 0.06f;
-                       uiDefButF(block, NUM, B_DIFF, "Margin", 10, 105, 105, 19, 
-                                       &ob->margin, 0.001, 1.0, 1, 0, 
-                                       "Collision margin");
-               } else {
-                       uiDefButF(block, NUM, B_DIFF, "Margin", 10, 105, 105, 19, 
-                                       &ob->margin, 0.0, 1.0, 1, 0, 
-                                       "Collision margin");
-               }
-               uiDefButBitI(block, TOG, OB_BOUNDS, B_REDR, "Bounds", 115, 105, 55, 19,
-                               &ob->gameflag, 0, 0,0, 0,
+               uiDefButBitI(block, TOG, OB_BOUNDS, B_REDR, "Bounds", 10, 105, 80, 19,
+                               &ob->gameflag, 0, 0, 0, 0,
                                "Specify a bounds object for physics");
                if (ob->gameflag & OB_BOUNDS) {
                        uiDefButS(block, MENU, REDRAWVIEW3D, "Boundary Display%t|Box%x0|Sphere%x1|Cylinder%x2|Cone%x3|Convex Hull%x5|Static Mesh%x4",
                        //almost ready to enable this one:                      uiDefButS(block, MENU, REDRAWVIEW3D, "Boundary Display%t|Box%x0|Sphere%x1|Cylinder%x2|Cone%x3|Convex Hull Polytope%x5|Static TriangleMesh %x4|Dynamic Mesh %x5|",
-                               170, 105, 105, 19, &ob->boundtype, 0, 0, 0, 0, "Selects the collision type");
-                       uiDefButBitI(block, TOG, OB_CHILD, B_REDR, "Compound", 275,105,75,19, 
+                               90, 105, 150, 19, &ob->boundtype, 0, 0, 0, 0, "Selects the collision type");
+                       uiDefButBitI(block, TOG, OB_CHILD, B_REDR, "Compound", 240,105,110,19, 
                                        &ob->gameflag, 0, 0, 0, 0, 
                                        "Add Children");
                }
index f2e20356f210ba7e2e8c1f683bf131b03c16d9b4..8ea71ce38dcb19338d65d5c9246d523e20d7fb1b 100644 (file)
@@ -2315,12 +2315,13 @@ static void render_panel_anim(void)
        uiBlockEndAlign(block);
 
        uiBlockSetCol(block, TH_AUTO);
-       uiDefBut(block, BUT,B_PLAYANIM, "PLAY",692,40,94,33, 0, 0, 0, 0, 0, "Play rendered images/avi animation (Ctrl+F11), (Play Hotkeys: A-Noskip, P-PingPong)");
-       uiDefButS(block, NUM, B_RTCHANGED, "rt:",789,40,95,33, &G.rt, -1000.0, 1000.0, 0, 0, "General testing/debug button");
+       uiDefBut(block, BUT,B_PLAYANIM, "PLAY",692,50,94,33, 0, 0, 0, 0, 0, "Play rendered images/avi animation (Ctrl+F11), (Play Hotkeys: A-Noskip, P-PingPong)");
+       uiDefButS(block, NUM, B_RTCHANGED, "rt:",789,50,95,33, &G.rt, -1000.0, 1000.0, 0, 0, "General testing/debug button");
 
        uiBlockBeginAlign(block);
-       uiDefButI(block, NUM,REDRAWSEQ,"Sta:",692,10,94,24, &G.scene->r.sfra,1.0,MAXFRAMEF, 0, 0, "The start frame of the animation (inclusive)");
-       uiDefButI(block, NUM,REDRAWSEQ,"End:",789,10,95,24, &G.scene->r.efra,SFRA,MAXFRAMEF, 0, 0, "The end  frame of the animation  (inclusive)");
+       uiDefButI(block, NUM,REDRAWSEQ,"Sta:",692,20,94,24, &G.scene->r.sfra,1.0,MAXFRAMEF, 0, 0, "The start frame of the animation (inclusive)");
+       uiDefButI(block, NUM,REDRAWSEQ,"End:",789,20,95,24, &G.scene->r.efra,SFRA,MAXFRAMEF, 0, 0, "The end  frame of the animation  (inclusive)");
+       uiDefButI(block, NUM,REDRAWSEQ,"Step:",692,0,192,18, &G.scene->frame_step, 1.0, MAXFRAMEF, 0, 0, "Frame Step");
        uiBlockEndAlign(block);
 }
 
index 6d5e1a62ad4967c9ffba2f51bcfb68d503b48192..c41047ed78829caa2ad201a74ed294a5fa201a01 100644 (file)
@@ -2535,7 +2535,10 @@ static void lamp_panel_mapto(Object *ob, Lamp *la)
        uiDefButF(block, NUMSLI, B_LAMPPRV, "DVar ",                    10,10,135,19, &(mtex->def_var), 0.0, 1.0, 0, 0, "Value to use for Ref, Spec, Amb, Emit, Alpha, RayMir, TransLu and Hard");
        
        /* MAP TO */
-       uiDefButBitS(block, TOG, MAP_COL, B_LAMPPRV, "Col",             10,180,135,19, &(mtex->mapto), 0, 0, 0, 0, "Lets the texture affect the basic color of the lamp");
+       uiBlockBeginAlign(block);
+       uiDefButBitS(block, TOG, LAMAP_COL, B_LAMPPRV, "Col",           10,180,135,19, &(mtex->mapto), 0, 0, 0, 0, "Lets the texture affect the basic color of the lamp");
+       uiDefButBitS(block, TOG, LAMAP_SHAD, B_LAMPPRV, "Shadow",               146,180,135,19, &(mtex->mapto), 0, 0, 0, 0, "Lets the texture affect the shadow color of the lamp");
+       uiBlockEndAlign(block);
        
        uiBlockBeginAlign(block);
        uiDefButS(block, MENU, B_LAMPPRV, mapto_blendtype_pup(),155,125,155,19, &(mtex->blendtype), 0, 0, 0, 0, "Texture blending mode");
@@ -2669,6 +2672,12 @@ static void lamp_panel_spot(Object *ob, Lamp *la)
        uiDefButBitI(block, TOG, LA_LAYER_SHADOW, B_LAMPPRV,"Layer",            10,90,80,19,&la->mode, 0, 0, 0, 0, "Causes only objects on the same layer to cast shadows");
        uiBlockEndAlign(block);
 
+       if(ELEM4(la->type, LA_AREA, LA_SPOT, LA_SUN, LA_LOCAL) && ((la->mode & LA_SHAD_RAY)||(la->mode & LA_SHAD_BUF))) {
+               uiBlockBeginAlign(block);
+               uiDefButF(block, COL, 0, "Shadow ",                             10,90,80,19,&la->shdwr, 0, 0, 0, B_COLLAMP, "Sets the shadow color; default is black (RGB 0,0,0)");
+               uiBlockEndAlign(block);
+       }
+
        if(la->type==LA_SPOT) {
                uiBlockBeginAlign(block);
                uiDefButBitI(block, TOG, LA_SQUARE, B_LAMPREDRAW,"Square",      10,60,80,19,&la->mode, 0, 0, 0, 0, "Sets square spotbundles");
index ec6a0f0d75b8174be547a8efaef9eaf4b381adb1..1454c0d4f091e29e2282254d7334874b2686ca76 100644 (file)
@@ -1315,7 +1315,7 @@ static void draw_ipohandles(int sel)
                                                glVertex2fv(fp+3); glVertex2fv(fp+6); 
                                                glEnd();
                                        }
-                                       else if( (bezt->f1 & 1)==sel) {
+                                       else if( (bezt->f1 & SELECT)==sel) {
                                                fp= bezt->vec[0];
                                                cpack(col[bezt->h1]);
                                                
index 8f22c704fd023198782ec8d768e20d767d621b5b..ba266fa8c297bd264e35f483537701ee22d6ee24 100644 (file)
@@ -467,7 +467,7 @@ void draw_mesh_text(Object *ob, int glsl)
        MFace *mf, *mface= me->mface;
        MTFace *tface= me->mtface;
        MCol *mcol= me->mcol;   /* why does mcol exist? */
-       bProperty *prop = get_property(ob, "Text");
+       bProperty *prop = get_ob_property(ob, "Text");
        GPUVertexAttribs gattribs;
        int a, totface= me->totface;
 
@@ -568,7 +568,7 @@ void draw_mesh_textured(Object *ob, DerivedMesh *dm, int faceselect)
                dm->drawFacesTex(dm, draw_tface__set_draw);
 
        /* draw game engine text hack */
-       if(get_property(ob, "Text")) 
+       if(get_ob_property(ob, "Text")) 
                draw_mesh_text(ob, 0);
 
        draw_textured_end();
index 8a3176e16b2bd626a4044b846982185a2abb08b1..527b36d0df418813358a65ed0e27723a6112b5ae 100644 (file)
@@ -2281,7 +2281,7 @@ static void draw_mesh_fancy(Base *base, int dt, int flag)
                        glFrontFace((ob->transflag&OB_NEG_SCALE)?GL_CW:GL_CCW);
 
                        dm->drawFacesGLSL(dm, GPU_enable_material);
-                       if(get_property(ob, "Text"))
+                       if(get_ob_property(ob, "Text"))
                                draw_mesh_text(ob, 1);
                        GPU_disable_material();
 
@@ -5187,7 +5187,7 @@ void draw_object(Base *base, int flag)
        }
 
        if(dt<OB_SHADED) {
-               if((ob->gameflag & OB_ACTOR) && (ob->gameflag & OB_DYNAMIC)) {
+               if(/*(ob->gameflag & OB_ACTOR) &&*/ (ob->gameflag & OB_DYNAMIC)) {
                        float tmat[4][4], imat[4][4], vec[3];
 
                        vec[0]= vec[1]= vec[2]= 0.0;
index 42576c901d7692eb9ad245f558d79fccd048ec6c..60d7ab599ab66ef9b10b0f9eb6e1178a4a14fc0d 100644 (file)
@@ -3422,7 +3422,7 @@ void drawview3dspace(ScrArea *sa, void *spacedata)
 
        /* run any view3d draw handler script links */
        if (sa->scriptlink.totscript)
-               BPY_do_spacehandlers(sa, 0, SPACEHANDLER_VIEW3D_DRAW);
+               BPY_do_spacehandlers(sa, 0, 0, SPACEHANDLER_VIEW3D_DRAW);
 
        /* run scene redraw script links */
        if((G.f & G_DOSCRIPTLINKS) && G.scene->scriptlink.totscript &&
index fe83976ee570d6be9f0e37c7abab81e874be091f..220265fcbaf565b39895d3aa6485f4c6aa06c69c 100644 (file)
@@ -2102,7 +2102,7 @@ void paste_actdata ()
        
        /* from selected channels */
        for (ale= act_data.first; ale; ale= ale->next) {
-               Ipo *ipo_src=NULL, *ipo_dst=ale->key_data;
+               Ipo *ipo_src=NULL;
                bActionChannel *achan;
                IpoCurve *ico, *icu;
                BezTriple *bezt;
@@ -2149,12 +2149,12 @@ void paste_actdata ()
                }
                
                /* this shouldn't happen, but it might */
-               if (ELEM(NULL, ipo_src, ipo_dst))
+               if (ipo_src == NULL)
                        continue;
                
                /* loop over curves, pasting keyframes */
                for (ico= ipo_src->curve.first; ico; ico= ico->next) {
-                       icu= verify_ipocurve((ID*)ob, ico->blocktype, actname, conname, "", ico->adrcode, 1);
+                       icu= verify_ipocurve((ID*)ob, ico->blocktype, actname, conname, NULL, ico->adrcode, 1);
                        
                        if (icu) {
                                /* just start pasting, with the the first keyframe on the current frame, and so on */
index 261bb26b0c4507d595e032587dfb09c3c0553598..f15ffcdcb58c852a6b225ba03d5041cc9f180625 100644 (file)
@@ -262,7 +262,7 @@ static void printweightsNurb__doPrint(void *userData, Nurb *nurb, BPoint *bp, Be
 {
        char str[30];
 
-       if (bp && (bp->f1&1)) {
+       if (bp && (bp->f1 & SELECT)) {
                sprintf(str,"%2.2f", bp->vec[3]);
 
                cpack(0x737373);
@@ -2916,12 +2916,12 @@ void addvert_Nurb(int mode)
        if((nu->type & 7)==CU_BEZIER) {
                /* which bezpoint? */
                if(bezt== nu->bezt) {   /* first */
-                       bezt->f1= bezt->f2= bezt->f3= 0;
+                       BEZ_DESEL(bezt);
                        newbezt =
                                (BezTriple*)MEM_callocN((nu->pntsu+1) * sizeof(BezTriple), "addvert_Nurb");
                        memcpy(newbezt+1, bezt, nu->pntsu*sizeof(BezTriple));
                        *newbezt= *bezt;
-                       newbezt->f1= newbezt->f2= newbezt->f3= SELECT;
+                       BEZ_SEL(newbezt);
                        if(newbezt->h1 >= 0) newbezt->h2= newbezt->h1;
                        else newbezt->h2= newbezt->h1= HD_ALIGN; /* does this ever happen? */
                        VECCOPY(temp, bezt->vec[1]);
@@ -2930,7 +2930,7 @@ void addvert_Nurb(int mode)
                        bezt= newbezt+1;
                }
                else if(bezt== (nu->bezt+nu->pntsu-1)) {  /* last */
-                       bezt->f1= bezt->f2= bezt->f3= 0;
+                       BEZ_DESEL(bezt);
                        newbezt =
                                (BezTriple*)MEM_callocN((nu->pntsu+1) * sizeof(BezTriple), "addvert_Nurb");
                        memcpy(newbezt, nu->bezt, nu->pntsu*sizeof(BezTriple));
@@ -2939,7 +2939,7 @@ void addvert_Nurb(int mode)
                        MEM_freeN(nu->bezt);
                        nu->bezt= newbezt;
                        newbezt+= nu->pntsu;
-                       newbezt->f1= newbezt->f2= newbezt->f3= SELECT;
+                       BEZ_SEL(newbezt);
                        if(newbezt->h1 >= 0) newbezt->h2= newbezt->h1;
                        else newbezt->h2= newbezt->h1= HD_ALIGN; /* does this ever happen? */
                        bezt= nu->bezt+nu->pntsu-1;
index fc0ac71908b00cf56ad05fa084d1db6b93387ce2..9a7f8e652a7bcfa1565fc04b86494e677da0a112 100644 (file)
@@ -1346,14 +1346,10 @@ void update_editipo_flags(void)
                        for(a=0; a<G.sipo->totipo; a++) {
                                if(ik->data[a]) {
                                        if(ik->flag & 1) {
-                                               ik->data[a]->f1 |= SELECT;
-                                               ik->data[a]->f2 |= SELECT;
-                                               ik->data[a]->f3 |= SELECT;
+                                               BEZ_SEL(ik->data[a]);
                                        }
                                        else {
-                                               ik->data[a]->f1 &= ~SELECT;
-                                               ik->data[a]->f2 &= ~SELECT;
-                                               ik->data[a]->f3 &= ~SELECT;
+                                               BEZ_DESEL(ik->data[a]);
                                        }
                                }
                        }
@@ -1451,7 +1447,7 @@ static short findnearest_ipovert(IpoCurve **icu, BezTriple **bezt)
                                        if(ei->disptype!=IPO_DISPBITS && ei->icu->ipo==IPO_BEZ) {
                                                /* middle points get an advantage */
                                                temp= -3+abs(mval[0]- sco[0][0])+ abs(mval[1]- sco[0][1]);
-                                               if( bezt1->f1 & 1) temp+=5;
+                                               if( bezt1->f1 & SELECT) temp+=5;
                                                if(temp<dist) { 
                                                        hpoint= 0; 
                                                        *bezt= bezt1; 
@@ -1542,18 +1538,18 @@ void mouse_select_ipo(void)
                        if(bezt) {
                                if(hand==1) {
                                        if(BEZSELECTED(bezt)) {
-                                               bezt->f1= bezt->f2= bezt->f3= 0;
+                                               BEZ_DESEL(bezt);
                                        }
                                        else {
-                                               bezt->f1= bezt->f2= bezt->f3= SELECT;
+                                               BEZ_SEL(bezt);
                                        }
                                }
                                else if(hand==0) {
-                                       if(bezt->f1 & SELECT) bezt->f1= 0;
+                                       if(bezt->f1 & SELECT) bezt->f1 &= ~SELECT;
                                        else bezt->f1= SELECT;
                                }
                                else {
-                                       if(bezt->f3 & SELECT) bezt->f3= 0;
+                                       if(bezt->f3 & SELECT) bezt->f3 &= ~SELECT;
                                        else bezt->f3= SELECT;
                                }
                        }                               
@@ -1563,7 +1559,7 @@ void mouse_select_ipo(void)
                        
                        if(bezt) {
                                if(hand==1) {
-                                       bezt->f1|= SELECT; bezt->f2|= SELECT; bezt->f3|= SELECT;
+                                       BEZ_SEL(bezt);
                                }
                                else if(hand==0) bezt->f1 |= SELECT;
                                else bezt->f3 |= SELECT;
@@ -2290,7 +2286,7 @@ void add_duplicate_editipo(void)
                                        while(b--) {
                                                *beztn= *bezt;
                                                if(bezt->f2 & SELECT) {
-                                                       beztn->f1= beztn->f2= beztn->f3= 0;
+                                                       BEZ_DESEL(beztn);
                                                        beztn++;
                                                        *beztn= *bezt;
                                                }
@@ -3503,14 +3499,10 @@ void make_ipokey(void)
                        if(ik->data[a]) {
                                bezt= ik->data[a];
                                if(sel) {
-                                       bezt->f1 |= SELECT;
-                                       bezt->f2 |= SELECT;
-                                       bezt->f3 |= SELECT;
+                                       BEZ_SEL(bezt);
                                }
                                else {
-                                       bezt->f1 &= ~SELECT;
-                                       bezt->f2 &= ~SELECT;
-                                       bezt->f3 &= ~SELECT;
+                                       BEZ_DESEL(bezt);
                                }
                        }
                }
@@ -3618,15 +3610,11 @@ void make_ipokey_transform(Object *ob, ListBase *lb, int sel)
                icu= icu->next;
        }
        
-       
-       ik= lb->first;
-       while(ik) {
-               /* map ipo-keys for drawing/editing if scaled ipo */
-               if (NLA_IPO_SCALED) {
+       if (NLA_IPO_SCALED) {
+               for (ik= lb->first; ik; ik= ik->next) {
+                       /* map ipo-keys for drawing/editing if scaled ipo */
                        ik->val= get_action_frame_inv(OBACT, ik->val);
                }
-               
-               ik= ik->next;
        }
 }
 
@@ -4678,7 +4666,7 @@ void duplicate_ipo_keys(Ipo *ipo)
        for (icu=ipo->curve.first; icu; icu=icu->next){
                for (i=0; i<icu->totvert; i++){
                        /* If a key is selected */
-                       if (icu->bezt[i].f2 & 1){
+                       if (icu->bezt[i].f2 & SELECT){
                                /* Expand the list */
                                newbezt = MEM_callocN(sizeof(BezTriple) * (icu->totvert+1), "beztriple");
                                memcpy (newbezt, icu->bezt, sizeof(BezTriple) * (i+1));
@@ -4688,15 +4676,10 @@ void duplicate_ipo_keys(Ipo *ipo)
                                MEM_freeN (icu->bezt);
                                icu->bezt=newbezt;
                                /* Unselect the current key*/
-                               icu->bezt[i].f1 &= ~ 1;
-                               icu->bezt[i].f2 &= ~ 1;
-                               icu->bezt[i].f3 &= ~ 1;
+                               BEZ_DESEL(&icu->bezt[i]);
                                i++;
                                /* Select the copied key */
-                               icu->bezt[i].f1 |= 1;
-                               icu->bezt[i].f2 |= 1;
-                               icu->bezt[i].f3 |= 1;
-                               
+                               BEZ_SEL(&icu->bezt[i]);
                        }
                }
        }
index 24bb111c8d1639a3ce57750e85930660c76bae8e..94a373d58416a658870e1f1ba7af766845d0f2f6 100644 (file)
@@ -136,10 +136,10 @@ void swap_selectall_editipo(void)
                                        b= ei->icu->totvert;
                                        while(b--) {
                                                if(totipo_vertsel) {
-                                                       bezt->f1= bezt->f2= bezt->f3= 0;
+                                                       BEZ_DESEL(bezt);
                                                }
                                                else {
-                                                       bezt->f1= bezt->f2= bezt->f3= SELECT;
+                                                       BEZ_SEL(bezt);
                                                }
                                                bezt++;
                                        }
@@ -228,7 +228,7 @@ void deselectall_editipo(void)
                                        bezt= ei->icu->bezt;
                                        b= ei->icu->totvert;
                                        while(b--) {
-                                               bezt->f1= bezt->f2= bezt->f3= 0;
+                                               BEZ_SEL(bezt);
                                                bezt++;
                                        }
                                }
@@ -374,18 +374,14 @@ static int selected_bezier_loop(int (*looptest)(EditIpo *),
 int select_bezier_add(BezTriple *bezt) 
 {
        /* Select the bezier triple */
-       bezt->f1 |= SELECT;
-       bezt->f2 |= SELECT;
-       bezt->f3 |= SELECT;
+       BEZ_SEL(bezt);
        return 0;
 }
 
 int select_bezier_subtract(BezTriple *bezt) 
 {
        /* Deselect the bezier triple */
-       bezt->f1 &= ~SELECT;
-       bezt->f2 &= ~SELECT;
-       bezt->f3 &= ~SELECT;
+       BEZ_DESEL(bezt);
        return 0;
 }
 
@@ -412,9 +408,9 @@ static int set_bezier_auto(BezTriple *bezt)
        /* is a handle selected? If so
         * set it to type auto
         */
-       if(bezt->f1 || bezt->f3) {
-               if(bezt->f1) bezt->h1= 1; /* the secret code for auto */
-               if(bezt->f3) bezt->h2= 1;
+       if((bezt->f1  & SELECT) || (bezt->f3 & SELECT)) {
+               if(bezt->f1 & SELECT) bezt->h1= 1; /* the secret code for auto */
+               if(bezt->f3 & SELECT) bezt->h2= 1;
 
                /* if the handles are not of the same type, set them
                 * to type free
@@ -435,9 +431,9 @@ static int set_bezier_vector(BezTriple *bezt)
        /* is a handle selected? If so
         * set it to type vector
         */
-       if(bezt->f1 || bezt->f3) {
-               if(bezt->f1) bezt->h1= 2; /* the code for vector */
-               if(bezt->f3) bezt->h2= 2;
+       if((bezt->f1 & SELECT) || (bezt->f3 & SELECT)) {
+               if(bezt->f1 & SELECT) bezt->h1= 2; /* the code for vector */
+               if(bezt->f3 & SELECT) bezt->h2= 2;
     
                /* if the handles are not of the same type, set them
                 * to type free
@@ -455,8 +451,8 @@ static int bezier_isfree(BezTriple *bezt)
        /* queries whether the handle should be set
         * to type 'free' (I think)
         */
-       if(bezt->f1 && bezt->h1) return 1;
-       if(bezt->f3 && bezt->h2) return 1;
+       if((bezt->f1 & SELECT) && bezt->h1) return 1;
+       if((bezt->f3 & SELECT) && bezt->h2) return 1;
        return 0;
 }
 
@@ -464,8 +460,8 @@ static int set_bezier_free(BezTriple *bezt)
 {
        /* Sets selected bezier handles to type 'free' 
         */
-       if(bezt->f1) bezt->h1= HD_FREE;
-       if(bezt->f3) bezt->h2= HD_FREE;
+       if(bezt->f1 & SELECT) bezt->h1= HD_FREE;
+       if(bezt->f3 & SELECT) bezt->h2= HD_FREE;
        return 0;
 }
 
@@ -473,8 +469,8 @@ static int set_bezier_align(BezTriple *bezt)
 {
        /* Sets selected bezier handles to type 'align' 
         */
-       if(bezt->f1) bezt->h1= HD_ALIGN;
-       if(bezt->f3) bezt->h2= HD_ALIGN;
+       if(bezt->f1 & SELECT) bezt->h1= HD_ALIGN;
+       if(bezt->f3 & SELECT) bezt->h2= HD_ALIGN;
        return 0;
 }
 
@@ -1032,6 +1028,7 @@ void borderselect_ipo(void)
                                select_proj_ipo(&rectf, val);
                }
                else {
+                       int selflag= (val==LEFTMOUSE) ? SELECT : 0;
                        
                        ei= G.sipo->editipo;
                        for(a=0; a<G.sipo->totipo; a++, ei++) {
@@ -1040,14 +1037,12 @@ void borderselect_ipo(void)
                                                b= ei->icu->totvert;
                                                bezt= ei->icu->bezt;
                                                while(b--) {
-                                                       int bit= (val==LEFTMOUSE);
-                                                       
                                                        if(BLI_in_rctf(&rectf, bezt->vec[0][0], bezt->vec[0][1]))
-                                                               bezt->f1 = (bezt->f1&~SELECT) | bit;
+                                                               bezt->f1 = selflag ? (bezt->f1 | SELECT) : (bezt->f1 & ~SELECT);
                                                        if(BLI_in_rctf(&rectf, bezt->vec[1][0], bezt->vec[1][1]))
-                                                               bezt->f2 = (bezt->f2&~SELECT) | bit;
+                                                               bezt->f2 = selflag ? (bezt->f2 | SELECT) : (bezt->f2 & ~SELECT);
                                                        if(BLI_in_rctf(&rectf, bezt->vec[2][0], bezt->vec[2][1]))
-                                                               bezt->f3 = (bezt->f3&~SELECT) | bit;
+                                                               bezt->f3 = selflag ? (bezt->f3 | SELECT) : (bezt->f3 & ~SELECT);
 
                                                        bezt++;
                                                }
@@ -1211,19 +1206,13 @@ void set_ipo_key_selection(Ipo *ipo, int sel)
        for (icu=ipo->curve.first; icu; icu=icu->next){
                for (i=0; i<icu->totvert; i++){
                        if (sel == 2) {
-                               icu->bezt[i].f1^=1;
-                               icu->bezt[i].f2^=1;
-                               icu->bezt[i].f3^=1;
+                               BEZ_INVSEL(&icu->bezt[i]);
                        }
                        else if (sel == 1){
-                               icu->bezt[i].f1|=1;
-                               icu->bezt[i].f2|=1;
-                               icu->bezt[i].f3|=1;
+                               BEZ_SEL(&icu->bezt[i]);
                        }
                        else{
-                               icu->bezt[i].f1&=~1;
-                               icu->bezt[i].f2&=~1;
-                               icu->bezt[i].f3&=~1;
+                               BEZ_DESEL(&icu->bezt[i]);
                        }
                }
        }
@@ -1240,10 +1229,10 @@ int fullselect_ipo_keys(Ipo *ipo)
        
        for (icu=ipo->curve.first; icu; icu=icu->next) {
                for (i=0; i<icu->totvert; i++){
-                       if (icu->bezt[i].f2 & 1){
+                       if (icu->bezt[i].f2 & SELECT){
                                tvtot+=3;
-                               icu->bezt[i].f1 |= 1;
-                               icu->bezt[i].f3 |= 1;
+                               icu->bezt[i].f1 |= SELECT;
+                               icu->bezt[i].f3 |= SELECT;
                        }
                }
        }
index 2c5386b86b66e81c4a7dea33cbe716ad7d5396bd..138dd93e490354e5633f0ab22a19d76708b49330 100644 (file)
@@ -519,6 +519,7 @@ static CutCurve *get_mouse_trail(int *len, char mode, char cutmode, struct GHash
                glDrawBuffer(GL_FRONT);
                headerprint("(LMB) draw, (MMB) constrain to x/y screen axis, (Enter) cut (with Ctrl to select cut line), (Esc) cancel");
        }
+       bglFlush();
        
        persp(PERSP_WIN);
        
@@ -620,14 +621,14 @@ static CutCurve *get_mouse_trail(int *len, char mode, char cutmode, struct GHash
                
                if ((i>1)&&(i!=lasti)) {  /*Draw recorded part of curve */
                        sdrawline((int)curve[i-2].x, (int)curve[i-2].y, (int)curve[i-1].x, (int)curve[i-1].y);
-                       glFlush();
+                       bglFlush();
                }
                
                if ((i==lasti)&&(i>0)) { /*Draw rubberband */
                        glLineWidth(2.0);
                        sdrawXORline((int)curve[i-1].x, (int)curve[i-1].y,(int)mval[0], (int)mval[1]);
                        glLineWidth(1.0);
-                       glFlush();
+                       bglFlush();
                        rubberband=1;
                }
                lasti=i;
index 2459f7ed23c8f22270e83a884e0e75f41baa72f3..29d7b52487f3a594f1591aa8fda7cd00aa36eb87 100644 (file)
@@ -3192,7 +3192,7 @@ void flip_subdivison(int level)
  
 static void copymenu_properties(Object *ob)
 {      
-       bProperty *prop, *propn, *propc;
+       bProperty *prop;
        Base *base;
        int nr, tot=0;
        char *str;
@@ -3208,45 +3208,43 @@ static void copymenu_properties(Object *ob)
                return;
        }
        
-       str= MEM_callocN(24+32*tot, "copymenu prop");
+       str= MEM_callocN(50 + 33*tot, "copymenu prop");
        
-       strcpy(str, "Copy Property %t");
+       strcpy(str, "Copy Property %t|Replace All|Merge All|%l");
        
        tot= 0; 
        prop= ob->prop.first;
        while(prop) {
                tot++;
-               strcat(str, " |");
+               strcat(str, "|");
                strcat(str, prop->name);
                prop= prop->next;
        }
 
        nr= pupmenu(str);
-       if(nr>0) {
-               tot= 0;
-               prop= ob->prop.first;
-               while(prop) {
-                       tot++;
-                       if(tot==nr) break;
-                       prop= prop->next;
+       
+       if ( nr==1 || nr==2 ) {
+               base= FIRSTBASE;
+               while(base) {
+                       if((base != BASACT) && TESTBASELIB(base)) {
+                               if (nr==1) { /* replace */
+                                       copy_properties( &base->object->prop, &ob->prop );
+                               } else {
+                                       for(prop = ob->prop.first; prop; prop= prop->next ) {
+                                               set_ob_property(base->object, prop);
+                                       }
+                               }
+                       }
+                       base= base->next;
                }
+       } else if(nr>0) {
+               prop = BLI_findlink(&ob->prop, nr-4); /* account for first 3 menu items & menu index starting at 1*/
+               
                if(prop) {
-                       propc= prop;
-                       
-                       base= FIRSTBASE;
-                       while(base) {
-                               if(base != BASACT) {
-                                       if(TESTBASELIB(base)) {
-                                               prop= get_property(base->object, propc->name);
-                                               if(prop) {
-                                                       free_property(prop);
-                                                       BLI_remlink(&base->object->prop, prop);
-                                               }
-                                               propn= copy_property(propc);
-                                               BLI_addtail(&base->object->prop, propn);
-                                       }
+                       for(base= FIRSTBASE; base; base= base->next) {
+                               if((base != BASACT) && TESTBASELIB(base)) {
+                                       set_ob_property(base->object, prop);
                                }
-                               base= base->next;
                        }
                }
        }
@@ -3672,6 +3670,9 @@ void copy_attr(short event)
                                else if(event==30) { /* index object */
                                        base->object->index= ob->index;
                                }
+                               else if(event==31) { /* object color */
+                                       QUATCOPY(base->object->col, ob->col);
+                               }
                        }
                }
                base= base->next;
@@ -3710,7 +3711,7 @@ void copy_attr_menu()
         * view3d_edit_object_copyattrmenu() and in toolbox.c
         */
        
-       strcpy(str, "Copy Attributes %t|Location%x1|Rotation%x2|Size%x3|Draw Options%x4|Time Offset%x5|Dupli%x6|%l|Mass%x7|Damping%x8|All Physical Attributes%x11|Properties%x9|Logic Bricks%x10|Protected Transform%x29|%l");
+       strcpy(str, "Copy Attributes %t|Location%x1|Rotation%x2|Size%x3|Draw Options%x4|Time Offset%x5|Dupli%x6|Object Color%x31|%l|Mass%x7|Damping%x8|All Physical Attributes%x11|Properties%x9|Logic Bricks%x10|Protected Transform%x29|%l");
        
        strcat (str, "|Object Constraints%x22");
        strcat (str, "|NLA Strips%x26");
index e9d0b57a166395f9907bd96c821fb4a4a97d3dfb..d16e3f28671253d3ac986c8951b72638bd452d57 100644 (file)
@@ -687,6 +687,24 @@ static void recurs_sel_seq(Sequence *seqm)
        }
 }
 
+void select_single_seq(Sequence *seq, int deselect_all)
+{
+       if(deselect_all)
+               deselect_all_seq();
+       set_last_seq(seq);
+
+       if((seq->type==SEQ_IMAGE) || (seq->type==SEQ_MOVIE)) {
+               if(seq->strip)
+                       strncpy(last_imagename, seq->strip->dir, FILE_MAXDIR-1);
+       }
+       else if((seq->type==SEQ_HD_SOUND) || (seq->type==SEQ_RAM_SOUND)) {
+               if(seq->strip)
+                       strncpy(last_sounddir, seq->strip->dir, FILE_MAXDIR-1);
+       }
+       seq->flag|= SELECT;
+       recurs_sel_seq(seq);
+}
+
 void swap_select_seq(void)
 {
        Sequence *seq;
@@ -932,7 +950,11 @@ void mouse_select_seq(void)
                }
                force_draw_plus(SPACE_BUTS, 0);
 
-               if(get_last_seq()) allqueue(REDRAWIPO, 0);
+               if(get_last_seq()) {
+                       allqueue(REDRAWIPO, 0);
+                       allqueue(REDRAWOOPS, 0);
+               }
+
                BIF_undo_push("Select Strips, Sequencer");
 
                std_rmouse_transform(transform_seq_nomarker);
@@ -2211,6 +2233,7 @@ void del_seq(void)
 
        BIF_undo_push("Delete Strip(s), Sequencer");
        allqueue(REDRAWSEQ, 0);
+       allqueue(REDRAWOOPS, 0);
 }
 
 static Sequence *dupli_seq(Sequence *seq) 
@@ -2897,7 +2920,7 @@ void un_meta(void)
 
        BIF_undo_push("Un-Make Meta Strip, Sequencer");
        allqueue(REDRAWSEQ, 0);
-
+       allqueue(REDRAWOOPS, 0);
 }
 
 void exit_meta(void)
@@ -2930,6 +2953,7 @@ void exit_meta(void)
 
        MEM_freeN(ms);
        allqueue(REDRAWSEQ, 0);
+       allqueue(REDRAWOOPS, 0);
 
        BIF_undo_push("Exit Meta Strip, Sequence");
 }
@@ -2958,6 +2982,7 @@ void enter_meta(void)
 
        set_last_seq(NULL);
        allqueue(REDRAWSEQ, 0);
+       allqueue(REDRAWOOPS, 0);
        BIF_undo_push("Enter Meta Strip, Sequence");
 }
 
index 69e3d4c7aac25b2907a133fce02d468bece21a9b..69a44aff1e467a034d1951f936b06fe3ecae0c64 100644 (file)
@@ -290,7 +290,6 @@ static int get_cached_work_texture(int *w_r, int *h_r)
        return texid;
 }
 
-#define FTOCHAR(val) val<=0.0f?0: (val>=1.0f?255: (char)(255.0f*val))
 void glaDrawPixelsTex(float x, float y, int img_w, int img_h, int format, void *rect)
 {
        float *f_rect;
index ad65705b79d04b3a9ea9263d2a7b56cdf85dc54e..68326c330ad2430f723ad91fde798ff27369ce60 100644 (file)
@@ -559,15 +559,15 @@ void oops_buttons(void)
        else {
                if(G.main->library.first) 
 #ifdef WITH_VERSE
-                       uiDefButS(block, MENU, B_REDR, "Outliner Display%t|Verse Servers %x9|Verse Sessions %x8|Libraries %x7|All Scenes %x0|Current Scene %x1|Visible Layers %x2|Groups %x6|Same Types %x5|Selected %x3|Active %x4",    xco, 0, 100, 20,  &soops->outlinevis, 0, 0, 0, 0, "");
+                       uiDefButS(block, MENU, B_REDR, "Outliner Display%t|Verse Servers %x9|Verse Sessions %x8|Libraries %x7|All Scenes %x0|Current Scene %x1|Visible Layers %x2|Groups %x6|Same Types %x5|Selected %x3|Active %x4|Sequence %x10",      xco, 0, 100, 20,  &soops->outlinevis, 0, 0, 0, 0, "");
 #else
-                       uiDefButS(block, MENU, B_REDR, "Outliner Display%t|Libraries %x7|All Scenes %x0|Current Scene %x1|Visible Layers %x2|Groups %x6|Same Types %x5|Selected %x3|Active %x4",         xco, 0, 100, 20,  &soops->outlinevis, 0, 0, 0, 0, "");
+                       uiDefButS(block, MENU, B_REDR, "Outliner Display%t|Libraries %x7|All Scenes %x0|Current Scene %x1|Visible Layers %x2|Groups %x6|Same Types %x5|Selected %x3|Active %x4|Sequence %x10",   xco, 0, 100, 20,  &soops->outlinevis, 0, 0, 0, 0, "");
 #endif /* WITH_VERSE */
                else
 #ifdef WITH_VERSE
-                       uiDefButS(block, MENU, B_REDR, "Outliner Display%t|Verse Servers %x9|Verse Sessions %x8|All Scenes %x0|Current Scene %x1|Visible Layers %x2|Groups %x6|Same Types %x5|Selected %x3|Active %x4",  xco, 0, 100, 20,  &soops->outlinevis, 0, 0, 0, 0, "");
+                       uiDefButS(block, MENU, B_REDR, "Outliner Display%t|Verse Servers %x9|Verse Sessions %x8|All Scenes %x0|Current Scene %x1|Visible Layers %x2|Groups %x6|Same Types %x5|Selected %x3|Active %x4|Sequence %x10",    xco, 0, 100, 20,  &soops->outlinevis, 0, 0, 0, 0, "");
 #else
-                       uiDefButS(block, MENU, B_REDR, "Outliner Display%t|All Scenes %x0|Current Scene %x1|Visible Layers %x2|Groups %x6|Same Types %x5|Selected %x3|Active %x4",       xco, 0, 100, 20,  &soops->outlinevis, 0, 0, 0, 0, "");
+                       uiDefButS(block, MENU, B_REDR, "Outliner Display%t|All Scenes %x0|Current Scene %x1|Visible Layers %x2|Groups %x6|Same Types %x5|Selected %x3|Active %x4|Sequence %x10",         xco, 0, 100, 20,  &soops->outlinevis, 0, 0, 0, 0, "");
 #endif /* WITH_VERSE */
        }
        
index 36ba819b3f126324a44420d069b64031bcdfd76e..827103cbb32d9c717a0291f3b6c9d0d70640d2f2 100644 (file)
@@ -885,6 +885,8 @@ void do_view3d_select_object_groupedmenu(void *arg, int event)
        case 7: /* Objects in Same Group */
        case 8: /* Object Hooks*/
        case 9: /* Object PassIndex*/
+       case 10: /* Object Color*/
+       case 11: /* Game Properties*/
                select_object_grouped((short)event);
                break;
        }
@@ -907,7 +909,9 @@ static uiBlock *view3d_select_object_groupedmenu(void *arg_unused)
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Objects on Shared Layers|Shift G, 6",            0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Objects in Same Group|Shift G, 7",               0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 7, "");
        uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Object Hooks|Shift G, 8",                0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 8, "");
-       uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Object PassIndex|Shift G, 9",            0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, "");   
+       uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Object PassIndex|Shift G, 9",            0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, "");
+       uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Object Color|Shift G, 0",                0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 10, "");  
+       uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Game Properties|Shift G, Alt+1",         0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 11, "");  
 
        uiBlockSetDirection(block, UI_RIGHT);
        uiTextBoundsBlock(block, 60);
index 52c5592be386cb3f2f78c5c7007f2effd5c93128..8d33496f068540d6c243bf4d58529233c352f56a 100644 (file)
 #include "DNA_texture_types.h"
 #include "DNA_text_types.h"
 #include "DNA_world_types.h"
+#include "DNA_sequence_types.h"
 
 #include "BLI_blenlib.h"
 
+#include "IMB_imbuf_types.h"
+
 #include "BKE_constraint.h"
 #include "BKE_deform.h"
 #include "BKE_depsgraph.h"
 #include "BIF_screen.h"
 #include "BIF_space.h"
 #include "BIF_toolbox.h"
+#include "BIF_editseq.h"
 
 #ifdef WITH_VERSE
 #include "BIF_verse.h"
@@ -301,7 +305,7 @@ static ID *outliner_search_back(SpaceOops *soops, TreeElement *te, short idcode)
        
        while(te) {
                tselem= TREESTORE(te);
-               if(te->idcode==idcode && tselem->type==0) return tselem->id;
+               if(tselem->type==0 && te->idcode==idcode) return tselem->id;
                te= te->parent;
        }
        return NULL;
@@ -558,8 +562,10 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i
        
        te->parent= parent;
        te->index= index;       // for data arays
-       te->name= id->name+2; // default, can be overridden by Library or non-ID data
-       te->idcode= GS(id->name);
+       if((type!=TSE_SEQUENCE) && (type != TSE_SEQ_STRIP) && (type != TSE_SEQUENCE_DUP)) {
+               te->name= id->name+2; // default, can be overridden by Library or non-ID data
+               te->idcode= GS(id->name);
+       }
        
        if(type==0) {
 
@@ -898,6 +904,65 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i
                        break;
                }
        }
+       else if(type==TSE_SEQUENCE) {
+               Sequence *seq= (Sequence*) idv;
+               Sequence *p;
+
+               /*
+                * The idcode is a little hack, but the outliner
+                * only check te->idcode if te->type is equal to zero,
+                * so this is "safe".
+                */
+               te->idcode= seq->type;
+               te->directdata= seq;
+
+               if(seq->type<7) {
+                       /*
+                        * This work like the sequence.
+                        * If the sequence have a name (not default name)
+                        * show it, in other case put the filename.
+                        */
+                       if(strcmp(seq->name, "SQ"))
+                               te->name= seq->name;
+                       else {
+                               if((seq->strip) && (seq->strip->stripdata))
+                                       te->name= seq->strip->stripdata->name;
+                               else if((seq->strip) && (seq->strip->tstripdata) && (seq->strip->tstripdata->ibuf))
+                                       te->name= seq->strip->tstripdata->ibuf->name;
+                               else
+                                       te->name= "SQ None";
+                       }
+
+                       if(seq->type==SEQ_META) {
+                               te->name= "Meta Strip";
+                               p= seq->seqbase.first;
+                               while(p) {
+                                       outliner_add_element(soops, &te->subtree, (void*)p, te, TSE_SEQUENCE, index);
+                                       p= p->next;
+                               }
+                       }
+                       else
+                               outliner_add_element(soops, &te->subtree, (void*)seq->strip, te, TSE_SEQ_STRIP, index);
+               }
+               else
+                       te->name= "Effect";
+       }
+       else if(type==TSE_SEQ_STRIP) {
+               Strip *strip= (Strip *)idv;
+
+               if(strip->dir)
+                       te->name= strip->dir;
+               else
+                       te->name= "Strip None";
+               te->directdata= strip;
+       }
+       else if(type==TSE_SEQUENCE_DUP) {
+               Sequence *seq= (Sequence*)idv;
+
+               te->idcode= seq->type;
+               te->directdata= seq;
+               te->name= seq->strip->stripdata->name;
+       }
 #ifdef WITH_VERSE
        else if(type==ID_VS) {
                struct VerseSession *session = (VerseSession*)idv;
@@ -964,6 +1029,62 @@ static void outliner_make_hierarchy(SpaceOops *soops, ListBase *lb)
        }
 }
 
+/* Helped function to put duplicate sequence in the same tree. */
+int need_add_seq_dup(Sequence *seq)
+{
+       Sequence *p;
+
+       if((!seq->strip) || (!seq->strip->stripdata) || (!seq->strip->stripdata->name))
+               return(1);
+
+       /*
+        * First check backward, if we found a duplicate
+        * sequence before this, don't need it, just return.
+        */
+       p= seq->prev;
+       while(p) {
+               if((!p->strip) || (!p->strip->stripdata) || (!p->strip->stripdata->name)) {
+                       p= p->prev;
+                       continue;
+               }
+
+               if(!strcmp(p->strip->stripdata->name, seq->strip->stripdata->name))
+                       return(2);
+               p= p->prev;
+       }
+
+       p= seq->next;
+       while(p) {
+               if((!p->strip) || (!p->strip->stripdata) || (!p->strip->stripdata->name)) {
+                       p= p->next;
+                       continue;
+               }
+
+               if(!strcmp(p->strip->stripdata->name, seq->strip->stripdata->name))
+                       return(0);
+               p= p->next;
+       }
+       return(1);
+}
+
+void add_seq_dup(SpaceOops *soops, Sequence *seq, TreeElement *te, short index)
+{
+       TreeElement *ch;
+       Sequence *p;
+
+       p= seq;
+       while(p) {
+               if((!p->strip) || (!p->strip->stripdata) || (!p->strip->stripdata->name)) {
+                       p= p->next;
+                       continue;
+               }
+
+               if(!strcmp(p->strip->stripdata->name, seq->strip->stripdata->name))
+                       ch= outliner_add_element(soops, &te->subtree, (void*)p, te, TSE_SEQUENCE, index);
+               p= p->next;
+       }
+}
+
 static void outliner_build_tree(SpaceOops *soops)
 {
        Base *base;
@@ -1120,6 +1241,30 @@ static void outliner_build_tree(SpaceOops *soops)
                }
        }
 #endif
+       else if(soops->outlinevis==SO_SEQUENCE) {
+               Sequence *seq;
+               Editing *ed;
+               int op;
+
+               ed= G.scene->ed;
+               if(!ed)
+                       retu