Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(339)

Issue 5504111: Interface for "Text" objects (bge) (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 3 months ago by dfelinto
Modified:
12 years, 3 months ago
Reviewers:
Moguri, z0r, bf-codereview
Base URL:
https://svn.blender.org/svnroot/bf-blender/trunk/blender/
Visibility:
Public.

Description

This patch creates an interface for ["Text"] properties in Font objects. Interface: http://www.pasteall.org/pic/show.php?id=23785 Simple test file: http://www.pasteall.org/blend/10616 Code Explanation: --------------- (1) it adds a toggle to add/remove a "Text" gameproperty. - internally this property is just another game property (so we can find it within the game.properties lookup). - the property itself has no 'value', the interface shows the content of ob.data.body instead (why? because gameproperties are per object, while the text is per data). (2) at BGE converter time it sets the current value of the object.data.body to the ["Text"] property. (3) if you change object.text (bge text property) it automatically convert ["Text"] to a CStringValue. *** that means if the original property was a CIntegerValue, it will be converted to CStringValue forever *** * the only to do I can think of is to add a warning at doversion time if user has ["Text"] property for a Font object *

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+156 lines, -11 lines) Patch
release/scripts/startup/bl_ui/space_logic.py View 2 chunks +26 lines, -0 lines 0 comments Download
source/blender/editors/object/object_edit.c View 2 chunks +12 lines, -2 lines 0 comments Download
source/blender/makesrna/RNA_enum_types.h View 1 chunk +2 lines, -0 lines 0 comments Download
source/blender/makesrna/intern/rna_property.c View 2 chunks +9 lines, -8 lines 0 comments Download
source/gameengine/Converter/KX_ConvertProperties.cpp View 2 chunks +94 lines, -0 lines 0 comments Download
source/gameengine/Ketsji/KX_FontObject.cpp View 2 chunks +13 lines, -1 line 0 comments Download

Messages

Total messages: 4
dfelinto
12 years, 3 months ago (2012-01-03 07:56:37 UTC) #1
Moguri
One of the main reasons for adding a dictionary interface to KX_GameObject (and thus it's ...
12 years, 3 months ago (2012-01-03 09:30:34 UTC) #2
z0r
On 2012/01/03 09:30:34, Moguri wrote: > One of the main reasons for adding a dictionary ...
12 years, 3 months ago (2012-01-03 10:37:59 UTC) #3
dfelinto
12 years, 3 months ago (2012-01-03 19:53:28 UTC) #4
>The underlying issue is that you want logic bricks to access a KX_FontObject
property.
Yup.

>Is this how we want to solve the problem?
What is your suggestion?
I have a feeling that the problem arises from the combination of ob.text and
ob["Text'']. Getting rid of ob.text may solve that (originally I proposed to
have ["Text"] to ALL font objects, automatically, but then we (Campbell and I)
thought that it would be more clear to the user if it was something he could
create/delete (also code-wise this avoids a lot of problems)


This is a hard API design issue. But, as Alex said, this may be the least bad
option.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b