Revision: 14718
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=14718
Author:   campbellbarton
Date:     2008-05-07 10:59:43 +0200 (Wed, 07 May 2008)

Log Message:
-----------
svn merge -r 14688:HEAD

Modified Paths:
--------------
    branches/apricot/release/scripts/bpymodules/BPyAddMesh.py
    branches/apricot/source/blender/include/BIF_imasel.h
    branches/apricot/source/blender/include/BSE_filesel.h
    branches/apricot/source/blender/python/api2_2x/Blender.c
    branches/apricot/source/blender/python/api2_2x/Material.c
    branches/apricot/source/blender/python/api2_2x/Sys.c
    branches/apricot/source/blender/python/api2_2x/doc/Material.py
    branches/apricot/source/blender/python/api2_2x/doc/Sys.py
    branches/apricot/source/blender/src/drawobject.c
    branches/apricot/source/blender/src/filesel.c
    branches/apricot/source/blender/src/headerbuttons.c
    branches/apricot/source/blender/src/imasel.c
    branches/apricot/source/blender/src/interface.c
    branches/apricot/source/blender/src/space.c
    branches/apricot/source/creator/creator.c
    branches/apricot/source/gameengine/Ketsji/KX_GameObject.cpp
    branches/apricot/source/gameengine/Ketsji/KX_GameObject.h
    branches/apricot/source/gameengine/PyDoc/KX_GameObject.py

Modified: branches/apricot/release/scripts/bpymodules/BPyAddMesh.py
===================================================================
--- branches/apricot/release/scripts/bpymodules/BPyAddMesh.py   2008-05-07 
07:57:18 UTC (rev 14717)
+++ branches/apricot/release/scripts/bpymodules/BPyAddMesh.py   2008-05-07 
08:59:43 UTC (rev 14718)
@@ -16,13 +16,17 @@
        scn = bpy.data.scenes.active
        if scn.lib: return
        ob_act = scn.objects.active
-       
+
+       is_editmode = EditMode()
+
        cursor = GetCursorPos()
-       try:    quat = Blender.Mathutils.Quaternion(GetViewQuat())
-       except: quat = None
+       quat = None
+       if is_editmode or Blender.Get('add_view_align'): # Aligning seems odd 
for editmode, but blender does it, oh well
+               try:    quat = Blender.Mathutils.Quaternion(GetViewQuat())
+               except: pass
        
        # Exist editmode for non mesh types
-       if ob_act and ob_act.type != 'Mesh' and EditMode():
+       if ob_act and ob_act.type != 'Mesh' and is_editmode:
                EditMode(0)
        
        # We are in mesh editmode
@@ -65,9 +69,10 @@
                        # Mesh with no data, unlikely
                        me.edges.extend(edges)
                        me.faces.extend(faces)
+
+               if is_editmode or Blender.Get('add_editmode'):
+                       EditMode(1)
                
-               EditMode(1)
-               
        else:
                
                # Object mode add new
@@ -90,10 +95,11 @@
                        ob_act.setMatrix(mat)
                
                ob_act.loc = cursor
-               
-               EditMode(1)
 
+               if is_editmode or Blender.Get('add_editmode'):
+                       EditMode(1)
 
+
 def write_mesh_script(filepath, me):
        '''
        filepath - path to py file

Modified: branches/apricot/source/blender/include/BIF_imasel.h
===================================================================
--- branches/apricot/source/blender/include/BIF_imasel.h        2008-05-07 
07:57:18 UTC (rev 14717)
+++ branches/apricot/source/blender/include/BIF_imasel.h        2008-05-07 
08:59:43 UTC (rev 14718)
@@ -34,6 +34,7 @@
 struct ID;
 
 void free_imasel(struct SpaceImaSel *simasel);
+void reset_imaselspace(struct ScrArea *sa);
 
 void clever_numbuts_imasel(void);
 

Modified: branches/apricot/source/blender/include/BSE_filesel.h
===================================================================
--- branches/apricot/source/blender/include/BSE_filesel.h       2008-05-07 
07:57:18 UTC (rev 14717)
+++ branches/apricot/source/blender/include/BSE_filesel.h       2008-05-07 
08:59:43 UTC (rev 14718)
@@ -54,6 +54,7 @@
 void activate_databrowse_args(struct ID *id, int idcode, int fromcode, short 
*menup, void (*func)(char *, void *, void *), void *arg1, void *arg2);
 
 void filesel_prevspace(void);
+void reset_filespace(struct ScrArea *sa);
 void free_filesel_spec(char *dir);
 void winqreadfilespace(struct ScrArea *sa, void *spacedata, struct BWinEvent 
*evt);
 void main_to_filelist(struct SpaceFile *sfile);   

Modified: branches/apricot/source/blender/python/api2_2x/Blender.c
===================================================================
--- branches/apricot/source/blender/python/api2_2x/Blender.c    2008-05-07 
07:57:18 UTC (rev 14717)
+++ branches/apricot/source/blender/python/api2_2x/Blender.c    2008-05-07 
08:59:43 UTC (rev 14718)
@@ -246,7 +246,8 @@
                        return EXPP_ReturnPyObjError( PyExc_ValueError,
                                        "expected an integer" );
 
-               G.scene->r.cfra = (short)PyInt_AsLong( arg ) ;
+               G.scene->r.cfra = (int)PyInt_AsLong( arg ) ;
+               CLAMP(G.scene->r.cfra, 1, MAXFRAME);
 
                /*      update all objects, so python scripts can export all 
objects
                 in a scene without worrying about the view layers */
@@ -545,8 +546,12 @@
        else if(StringEqual( str, "compressfile" ))
                ret = PyInt_FromLong( (U.flag & USER_FILECOMPRESS) >> 15  );
        else if(StringEqual( str, "mipmap" ))
-               ret = PyInt_FromLong( (U.gameflags & USER_DISABLE_MIPMAP) == 0  
);
-       else
+               ret = PyInt_FromLong( (U.gameflags & USER_DISABLE_MIPMAP)!=0  );
+       else if(StringEqual( str, "add_view_align" ))
+               ret = PyInt_FromLong( ((U.flag & USER_ADD_VIEWALIGNED)!=0)  );
+       else if(StringEqual( str, "add_editmode" ))
+               ret = PyInt_FromLong( ((U.flag & USER_ADD_EDITMODE)!=0)  );
+       else 
                return EXPP_ReturnPyObjError( PyExc_AttributeError, "unknown 
attribute" );
 
        if (ret) return ret;

Modified: branches/apricot/source/blender/python/api2_2x/Material.c
===================================================================
--- branches/apricot/source/blender/python/api2_2x/Material.c   2008-05-07 
07:57:18 UTC (rev 14717)
+++ branches/apricot/source/blender/python/api2_2x/Material.c   2008-05-07 
08:59:43 UTC (rev 14718)
@@ -128,6 +128,14 @@
 #define EXPP_MAT_FRESNELMIRR_MAX                       5.0
 #define EXPP_MAT_FRESNELMIRRFAC_MIN                    1.0
 #define EXPP_MAT_FRESNELMIRRFAC_MAX                    5.0
+#define EXPP_MAT_RAYMIRRGLOSS_MIN                       0.0
+#define EXPP_MAT_RAYMIRRGLOSS_MAX                       1.0
+#define EXPP_MAT_RAYMIRRGLOSSSAMPLES_MIN        0
+#define EXPP_MAT_RAYMIRRGLOSSSAMPLES_MAX        255
+#define EXPP_MAT_RAYTRANSPGLOSS_MIN                     0.0
+#define EXPP_MAT_RAYTRANSPGLOSS_MAX                     1.0
+#define EXPP_MAT_RAYTRANSPGLOSSSAMPLES_MIN      0
+#define EXPP_MAT_RAYTRANSPGLOSSSAMPLES_MAX      255
 #define EXPP_MAT_FILTER_MIN                    0.0
 #define EXPP_MAT_FILTER_MAX                    1.0
 #define EXPP_MAT_TRANSLUCENCY_MIN                      0.0
@@ -516,6 +524,10 @@
 static int Material_setTransDepth( BPy_Material * self, PyObject * value );
 static int Material_setFresnelTrans( BPy_Material * self, PyObject * value );
 static int Material_setFresnelTransFac( BPy_Material * self, PyObject * value 
);
+static int Material_setGlossMirr( BPy_Material * self, PyObject * value );
+static int Material_setGlossMirrSamples( BPy_Material * self, PyObject * value 
);
+static int Material_setGlossTrans( BPy_Material * self, PyObject * value );
+static int Material_setGlossTransSamples( BPy_Material * self, PyObject * 
value );
 static int Material_setRigidBodyFriction( BPy_Material * self, PyObject * 
value );
 static int Material_setRigidBodyRestitution( BPy_Material * self, PyObject * 
value );
 
@@ -600,6 +612,10 @@
 static PyObject *Material_getTransDepth( BPy_Material * self );
 static PyObject *Material_getFresnelTrans( BPy_Material * self );
 static PyObject *Material_getFresnelTransFac( BPy_Material * self );
+static PyObject *Material_getGlossMirr( BPy_Material * self );
+static PyObject *Material_getGlossMirrSamples( BPy_Material * self );
+static PyObject *Material_getGlossTrans( BPy_Material * self );
+static PyObject *Material_getGlossTransSamples( BPy_Material * self );
 static PyObject *Material_getRigidBodyFriction( BPy_Material * self );
 static PyObject *Material_getRigidBodyRestitution( BPy_Material * self );
 
@@ -720,6 +736,10 @@
         "() - Return fresnel power for refractions"},
        {"getFresnelMirrFac", ( PyCFunction ) Material_getFresnelMirrFac, 
METH_NOARGS,
         "() - Return fresnel power for refractions factor"},
+       {"getRayTransGloss", ( PyCFunction ) Material_getGlossTrans, 
METH_NOARGS,
+        "() - Return amount refraction glossiness"},
+       {"getRayMirrGlossSamples", ( PyCFunction ) 
Material_getGlossMirrSamples, METH_NOARGS,
+        "() - Return amount mirror glossiness"},
        {"getFilter", ( PyCFunction ) Material_getFilter, METH_NOARGS,
         "() - Return the amount of filtering when transparent raytrace is 
enabled"},
        {"getTranslucency", ( PyCFunction ) Material_getTranslucency, 
METH_NOARGS,
@@ -825,6 +845,10 @@
         "(f) - Set fresnel power for mirror - [0.0, 5.0]"},
        {"setFresnelMirrFac", ( PyCFunction ) Matr_oldsetFresnelMirrFac, 
METH_VARARGS,
         "(f) - Set blend fac for mirror fresnel - [1.0, 5.0]"},
+       {"setRayTransGloss", ( PyCFunction ) Material_setGlossTrans, 
METH_VARARGS,
+        "(f) - Set amount refraction glossiness - [0.0, 1.0]"},
+       {"setRayMirrGlossSamples", ( PyCFunction ) 
Material_setGlossMirrSamples, METH_VARARGS,
+        "(f) - Set amount mirror glossiness - [0.0, 1.0]"},
        {"setFilter", ( PyCFunction ) Matr_oldsetFilter, METH_VARARGS,
         "(f) - Set the amount of filtering when transparent raytrace is 
enabled"},
        {"setTranslucency", ( PyCFunction ) Matr_oldsetTranslucency, 
METH_VARARGS,
@@ -1030,6 +1054,22 @@
         (getter)Material_getRefracIndex, (setter)Material_setRefracIndex,
         "Material's Index of Refraction (applies to the \"Blinn\" Specular 
Shader only",
         NULL},
+       {"glossMir",
+        (getter)Material_getGlossMirr, (setter)Material_setGlossMirr,
+        "Reflection glossiness",
+        NULL},
+       {"sampGlossMir",
+        (getter)Material_getGlossMirrSamples, 
(setter)Material_setGlossMirrSamples,
+        "Reflection glossiness",
+        NULL},
+       {"glossTra",
+        (getter)Material_getGlossTrans, (setter)Material_setGlossTrans,
+        "Refraction glossiness",
+        NULL},
+       {"sampGlossTra",
+        (getter)Material_getGlossMirrSamples, 
(setter)Material_setGlossMirrSamples,
+        "Refraction glossiness",
+        NULL},
        {"rgbCol",
         (getter)Material_getRGBCol, (setter)Material_setRGBCol,
         "Diffuse RGB color triplet",
@@ -1578,6 +1618,26 @@
        return PyFloat_FromDouble( ( double ) self->material->fresnel_tra_i );
 }
 
+static PyObject *Material_getGlossMirr( BPy_Material * self )
+{
+       return PyFloat_FromDouble( ( double ) self->material->gloss_mir );
+}
+
+static PyObject *Material_getGlossMirrSamples( BPy_Material * self )
+{
+       return PyInt_FromLong( ( long ) self->material->samp_gloss_mir );
+}
+
+static PyObject *Material_getGlossTrans( BPy_Material * self )
+{
+       return PyFloat_FromDouble( ( double ) self->material->gloss_tra );
+}
+
+static PyObject *Material_getGlossTransSamples( BPy_Material * self )
+{
+       return PyInt_FromLong( ( long ) self->material->samp_gloss_tra );
+}
+
 static PyObject* Material_getRigidBodyFriction( BPy_Material * self )
 {
        return PyFloat_FromDouble( ( double ) self->material->friction );
@@ -2057,6 +2117,34 @@
                                                                
EXPP_MAT_FRESNELTRANSFAC_MAX );
 }
 
+static int Material_setGlossMirr( BPy_Material * self, PyObject * value )
+{
+       return EXPP_setFloatClamped ( value, &self->material->gloss_mir,
+                                                               
EXPP_MAT_RAYMIRRGLOSS_MIN,
+                                                               
EXPP_MAT_RAYMIRRGLOSS_MAX );
+}
+
+static int Material_setGlossMirrSamples( BPy_Material * self, PyObject * value 
)
+{
+       return EXPP_setIValueClamped ( value, &self->material->samp_gloss_mir,
+                                                               
EXPP_MAT_RAYMIRRGLOSSSAMPLES_MIN,
+                                                               
EXPP_MAT_RAYMIRRGLOSSSAMPLES_MAX, 'h' );
+}
+
+static int Material_setGlossTrans( BPy_Material * self, PyObject * value )
+{
+       return EXPP_setFloatClamped ( value, &self->material->gloss_tra,
+                                                               
EXPP_MAT_RAYTRANSPGLOSS_MIN,
+                                                               
EXPP_MAT_RAYTRANSPGLOSS_MAX );
+}
+
+static int Material_setGlossTransSamples( BPy_Material * self, PyObject * 
value )
+{
+       return EXPP_setIValueClamped ( value, &self->material->samp_gloss_tra,
+                                                               
EXPP_MAT_RAYTRANSPGLOSSSAMPLES_MIN,
+                                                               
EXPP_MAT_RAYTRANSPGLOSSSAMPLES_MAX, 'h' );
+}
+

@@ Diff output truncated at 10240 characters. @@

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to