[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [28985] branches/render25: Render Branch: svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r28978 :28984
Brecht Van Lommel
brecht at blender.org
Tue May 25 20:34:49 CEST 2010
Revision: 28985
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=28985
Author: blendix
Date: 2010-05-25 20:34:49 +0200 (Tue, 25 May 2010)
Log Message:
-----------
Render Branch: svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r28978:28984
Modified Paths:
--------------
branches/render25/release/scripts/modules/bpy_types.py
branches/render25/release/scripts/ui/properties_object.py
branches/render25/source/blender/blenkernel/intern/image.c
branches/render25/source/blender/blenloader/intern/readfile.c
branches/render25/source/creator/creator.c
Modified: branches/render25/release/scripts/modules/bpy_types.py
===================================================================
--- branches/render25/release/scripts/modules/bpy_types.py 2010-05-25 18:31:36 UTC (rev 28984)
+++ branches/render25/release/scripts/modules/bpy_types.py 2010-05-25 18:34:49 UTC (rev 28985)
@@ -38,6 +38,16 @@
return new_context
+class Group(bpy_types.ID):
+ __slots__ = ()
+
+ @property
+ def users_dupli_object(self):
+ """The dupli group this group is used in, XXX, TODO, WHY DOESNT THIS WORK???"""
+ import bpy
+ return tuple(obj for obj in bpy.data.objects if self == obj.dupli_object)
+
+
class Object(bpy_types.ID):
__slots__ = ()
@@ -48,18 +58,16 @@
return tuple(child for child in bpy.data.objects if child.parent == self)
@property
- def group_users(self):
+ def users_group(self):
"""The groups this object is in"""
import bpy
- name = self.name
- return tuple(group for group in bpy.data.groups if name in group.objects)
+ return tuple(group for group in bpy.data.groups if self in group.objects[:])
@property
- def scene_users(self):
+ def users_scene(self):
"""The scenes this object is in"""
import bpy
- name = self.name
- return tuple(scene for scene in bpy.data.scenes if name in scene.objects)
+ return tuple(scene for scene in bpy.data.scenes if self in scene.objects[:])
class _GenericBone:
Modified: branches/render25/release/scripts/ui/properties_object.py
===================================================================
--- branches/render25/release/scripts/ui/properties_object.py 2010-05-25 18:31:36 UTC (rev 28984)
+++ branches/render25/release/scripts/ui/properties_object.py 2010-05-25 18:34:49 UTC (rev 28985)
@@ -180,7 +180,7 @@
col.prop(group, "dupli_offset", text="")
prop = col.operator("wm.context_set_value", text="From Cursor")
- prop.path = "object.group_users[%d].dupli_offset" % index
+ prop.path = "object.users_group[%d].dupli_offset" % index
prop.value = value
index += 1
Modified: branches/render25/source/blender/blenkernel/intern/image.c
===================================================================
--- branches/render25/source/blender/blenkernel/intern/image.c 2010-05-25 18:31:36 UTC (rev 28984)
+++ branches/render25/source/blender/blenkernel/intern/image.c 2010-05-25 18:34:49 UTC (rev 28985)
@@ -982,6 +982,7 @@
struct StampData stamp_data;
float w, h, pad;
int x, y;
+ float h_fixed;
if (!rect && !rectf)
return;
@@ -998,16 +999,24 @@
BLF_buffer_col(mono, scene->r.fg_stamp[0], scene->r.fg_stamp[1], scene->r.fg_stamp[2], 1.0);
pad= BLF_width(mono, "--");
+ /* use 'h_fixed' rather then 'h', aligns better */
+ // BLF_width_and_height(mono, "^|/_AgPpJjlYy", &w, &h_fixed);
+ {
+ rctf box;
+ BLF_boundbox(mono, "^|/_AgPpJjlYy", &box);
+ h_fixed= box.ymax - box.ymin;
+ }
+
x= 0;
y= height;
if (stamp_data.file[0]) {
/* Top left corner */
- BLF_width_and_height(mono, stamp_data.file, &w, &h);
+ BLF_width_and_height(mono, stamp_data.file, &w, &h); h= h_fixed;
y -= h;
/* also a little of space to the background. */
- buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y-3, w+3, y+h+3);
+ buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y-3, w+3, y+h+2);
/* and draw the text. */
BLF_position(mono, x, y, 0.0);
@@ -1019,11 +1028,11 @@
/* Top left corner, below File */
if (stamp_data.note[0]) {
- BLF_width_and_height(mono, stamp_data.note, &w, &h);
+ BLF_width_and_height(mono, stamp_data.note, &w, &h); h= h_fixed;
y -= h;
/* and space for background. */
- buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, 0, y-2, w+3, y+h+2);
+ buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, 0, y-3, w+3, y+h+2);
BLF_position(mono, x, y+1, 0.0);
BLF_draw_buffer(mono, stamp_data.note);
@@ -1034,11 +1043,11 @@
/* Top left corner, below File (or Note) */
if (stamp_data.date[0]) {
- BLF_width_and_height(mono, stamp_data.date, &w, &h);
+ BLF_width_and_height(mono, stamp_data.date, &w, &h); h= h_fixed;
y -= h;
/* and space for background. */
- buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, 0, y-3, w+3, y+h+3);
+ buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, 0, y-3, w+3, y+h+2);
BLF_position(mono, x, y, 0.0);
BLF_draw_buffer(mono, stamp_data.date);
@@ -1049,11 +1058,11 @@
/* Top left corner, below File, Date or Note */
if (stamp_data.rendertime[0]) {
- BLF_width_and_height(mono, stamp_data.rendertime, &w, &h);
+ BLF_width_and_height(mono, stamp_data.rendertime, &w, &h); h= h_fixed;
y -= h;
/* and space for background. */
- buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, 0, y-3, w+3, y+h+3);
+ buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, 0, y-3, w+3, y+h+2);
BLF_position(mono, x, y, 0.0);
BLF_draw_buffer(mono, stamp_data.rendertime);
@@ -1064,10 +1073,10 @@
/* Bottom left corner, leaving space for timing */
if (stamp_data.marker[0]) {
- BLF_width_and_height(mono, stamp_data.marker, &w, &h);
+ BLF_width_and_height(mono, stamp_data.marker, &w, &h); h= h_fixed;
/* extra space for background. */
- buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y, w+2, y+h+3);
+ buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y, w+2, y+h+2);
/* and pad the text. */
BLF_position(mono, x, y+3, 0.0);
@@ -1079,10 +1088,10 @@
/* Left bottom corner */
if (stamp_data.time[0]) {
- BLF_width_and_height(mono, stamp_data.time, &w, &h);
+ BLF_width_and_height(mono, stamp_data.time, &w, &h); h= h_fixed;
/* extra space for background */
- buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y, x+w+2, y+h+3);
+ buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y, x+w+2, y+h+2);
/* and pad the text. */
BLF_position(mono, x, y+3, 0.0);
@@ -1093,10 +1102,10 @@
}
if (stamp_data.frame[0]) {
- BLF_width_and_height(mono, stamp_data.frame, &w, &h);
+ BLF_width_and_height(mono, stamp_data.frame, &w, &h); h= h_fixed;
/* extra space for background. */
- buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y, x+w+2, y+h+3);
+ buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y, x+w+2, y+h+2);
/* and pad the text. */
BLF_position(mono, x, y+3, 0.0);
@@ -1107,22 +1116,22 @@
}
if (stamp_data.camera[0]) {
- BLF_width_and_height(mono, stamp_data.camera, &w, &h);
+ BLF_width_and_height(mono, stamp_data.camera, &w, &h); h= h_fixed;
/* extra space for background. */
- buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y, x+w+2, y+h+3);
+ buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y, x+w+2, y+h+2);
BLF_position(mono, x, y+3, 0.0);
BLF_draw_buffer(mono, stamp_data.camera);
}
if (stamp_data.scene[0]) {
- BLF_width_and_height(mono, stamp_data.scene, &w, &h);
+ BLF_width_and_height(mono, stamp_data.scene, &w, &h); h= h_fixed;
/* Bottom right corner, with an extra space because blenfont is too strict! */
x= width - w - 2;
/* extra space for background. */
- buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y, x+w+3, y+h+3);
+ buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y, x+w+3, y+h+2);
/* and pad the text. */
BLF_position(mono, x, y+3, 0.0);
@@ -1130,14 +1139,14 @@
}
if (stamp_data.strip[0]) {
- BLF_width_and_height(mono, stamp_data.scene, &w, &h);
+ BLF_width_and_height(mono, stamp_data.scene, &w, &h); h= h_fixed;
/* Top right corner, with an extra space because blenfont is too strict! */
x= width - w - pad;
y= height - h;
/* extra space for background. */
- buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y-3, x+w+pad, y+h+3);
+ buf_rectfill_area(rect, rectf, width, height, scene->r.bg_stamp, x, y-3, x+w+pad, y+h+2);
BLF_position(mono, x, y, 0.0);
BLF_draw_buffer(mono, stamp_data.strip);
Modified: branches/render25/source/blender/blenloader/intern/readfile.c
===================================================================
--- branches/render25/source/blender/blenloader/intern/readfile.c 2010-05-25 18:31:36 UTC (rev 28984)
+++ branches/render25/source/blender/blenloader/intern/readfile.c 2010-05-25 18:34:49 UTC (rev 28985)
@@ -10998,31 +10998,34 @@
/* parent type to modifier */
for(ob = main->object.first; ob; ob = ob->id.next) {
if(ob->parent) {
- Object *parent= newlibadr(fd, lib, ob->parent);
- if(parent->type==OB_ARMATURE && ob->partype==PARSKEL) {
- ArmatureModifierData *amd;
+ Object *parent= (Object *)newlibadr(fd, lib, ob->parent);
+ if(parent) { /* parent may not be in group */
+ if(parent->type==OB_ARMATURE && ob->partype==PARSKEL) {
+ ArmatureModifierData *amd;
+ bArmature *arm= (bArmature *)newlibadr(fd, lib, parent->data);
- amd = (ArmatureModifierData*) modifier_new(eModifierType_Armature);
- amd->object = ob->parent;
- BLI_addtail((ListBase*)&ob->modifiers, amd);
- amd->deformflag= ((bArmature *)(parent->data))->deformflag;
- ob->partype = PAROBJECT;
- }
- else if(parent->type==OB_LATTICE && ob->partype==PARSKEL) {
- LatticeModifierData *lmd;
+ amd = (ArmatureModifierData*) modifier_new(eModifierType_Armature);
+ amd->object = ob->parent;
+ BLI_addtail((ListBase*)&ob->modifiers, amd);
+ amd->deformflag= arm->deformflag;
+ ob->partype = PAROBJECT;
+ }
+ else if(parent->type==OB_LATTICE && ob->partype==PARSKEL) {
+ LatticeModifierData *lmd;
- lmd = (LatticeModifierData*) modifier_new(eModifierType_Lattice);
- lmd->object = ob->parent;
- BLI_addtail((ListBase*)&ob->modifiers, lmd);
- ob->partype = PAROBJECT;
- }
- else if(parent->type==OB_CURVE && ob->partype==PARCURVE) {
- CurveModifierData *cmd;
+ lmd = (LatticeModifierData*) modifier_new(eModifierType_Lattice);
+ lmd->object = ob->parent;
+ BLI_addtail((ListBase*)&ob->modifiers, lmd);
+ ob->partype = PAROBJECT;
+ }
+ else if(parent->type==OB_CURVE && ob->partype==PARCURVE) {
+ CurveModifierData *cmd;
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list