[Bf-committers] cutedgeloop anomaly

Fredrik Axelsson fraxbe at gmail.com
Tue Jul 28 19:04:59 CEST 2009


Hello Everyone!

Today I decided to make my first foray into the blender source to modify:

void CutEdgeLoopSel(int numcuts) in editmesh_loop.c:218 ( blender-2.49a 
sources)

I wanted to modify it to display the number of loop cuts in the window 
header
before the cut was performed. To my surprise, I found that it is already
supposed to do that. But it didn't, on my machine. Only "(S)mooth: on" or
"(S)mooth off" showed up in the window header during the Loop Cut operation.

from editmesh_loop.c:247 --
=================
             sprintf(msg,"Number of Cuts: %d",numcuts);
             if(smooth){
                 sprintf(msg,"%s (S)mooth: on",msg);
             } else {
                 sprintf(msg,"%s (S)mooth: off",msg);
             }
=================

I then made a debug build to debug the function, but when I had recompiled
blender with debug symbols on, the problem disappeared, the "Number of Cuts:
%d" message appears in the window header.

My platform is linux-2.6.30 (gentoo amd64, glibc-2.10.1), I have tried 
it with both gcc-4.3.3 and gcc-4.4.1. The binaries from both compilers 
behave exactly the same way.

I attached a minimal patch, which replaces the last two sprintf calls 
with strcat calls instead. It seems to work as intended on my machine.

I'm wondering if anyone else can confirm this issue, or if anyone knows 
why it behaves like this.

Best regards,

Fredrik
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cutedgeloop.patch
Type: text/x-patch
Size: 400 bytes
Desc: not available
Url : http://lists.blender.org/pipermail/bf-committers/attachments/20090728/c6c5a7f5/attachment.bin 


More information about the Bf-committers mailing list