Logic Bricks allow same name for multiple bricks
Closed, ResolvedPublic

Description

Category: UI/Interface

LogicEditor:
Logic Bricks allow same brick-names for multiple bricks.

This causes many problems, one is if you delete a brick thats under another brick with same name - the top one will be deleted.
If u work with states this is a killer - cause u dont see it if the bricks not visible in the actual logicstate!

and it seems to handle the logic based on names - so if u have same name bricks, logic gets wrong calculated !


See attached file - remove (X) one of the lower bricks - the upper will be deleted

tested in 2.60 and 2.60a and 2.59 (official win64 zips)

Details

Type
Bug

In blender 2.61 svn:
version 2.61 (sub 0), revision 43162. Release
build date: 2012-01-05, 13:31:55
platform: Linux

It seems that it is not possible to introduce two logic bricks with the same name in blender 2.61. But if you load an old blend file you have the problem described above yet

the logicbrick name handling needs to be reviewed - or should be... :)
because under some circumstances it is still happening that two bricks gets same name and mess up the logic (especialy on deletion of bricks)

dont know if its possible to check the code for that - im not a programmer myself

if its not possible - someone could close this bug IMO

happy blending :) and thank you
Tobi

Dalai, you've messed with this code before, right? Do you have any comments on this bug report?

Two things: (1) If we no longer can have duplicated names I think that part of the code is fine. It needs to be double-checked though, I think you can still have duplcated names if you add the s/c/a via Python. (2) the s/c/a operators currently take a name as input. One thing that can be done is to add the active s/c/a in the context, and *optionally* retrieve it in the operator (I say optionally because we still want to be able to pass a s/c/a name for the operator directly).

After this commit 072d80a9de3 the SCA name duplication follows a behaviour similar to blender one. Even when you use python to create the SCAs you can not create SCAs with duplicate names.

Then this another patch D1109 takes care of avoiding the duplicated names when loading the old files.

Jorge Bernal (lordloki) closed this task as Resolved.Mar 10 2015, 3:05 PM
Jorge Bernal (lordloki) claimed this task.

I close this report as nowadays It is not possible to introduce the same name (via python or via SCA) to the logic bricks.

Old blend files should be converted manually as automatic converting leads to a possible python/SCA logic break.

Thanks for your time.