propertie crash ?

did a simple add mesh script and when I change the first parameter at top
It crashes !
for 1 and last properties!

file is here
stars-ver3.blend (116 KB)

I tried to add another parameter and it also crash

data file is like :



Name, Mag,  RA(degrees),  Dec(degrees)
SIRIUS,-1.46,101.2870833,-16.71611111
CANOPUS,-0.72,95.98833333,-52.69555556
ARCTURUS,-0.04,213.915,19.1825
RIGEL KENT,-0.01,219.9008333,-60.83527778
VEGA,0.03,279.2341667,38.78361111
CAPELLA,0.08,79.17208333,45.99805556
RIGEL,0.12,78.63416667,-8.201666667
PROCYON,0.38,114.8254167,5.225
ACHERNAR,0.46,24.42875,-57.23666667
BETELGEUSE,0.5,88.79291667,7.406944444
HADAR,0.61,210.9558333,-60.37277778
ALTAIR,0.77,297.6954167,8.868333333
ALDEBARAN,0.85,68.98,16.50916667



save under name = BSC4-10.py

is this a bug or what ?

thanks for feedback

Passing a variable holding a reference to a bmesh is not a good idea, in case of a wrapped bm it’s likely to die as it is passed.

Not sure if this is reason however. Could be another dangling reference, which can lead to immediate crashes on access.

sorry i’m not using Bm I will remove it and see if it is that !

just copying object to add new one !

just did a test without the Bm and still crashing!

if i change any properties it crashes now !

thanks

I remove most of the procedure inside the execute function
and it works fine

so something is wrong with the procedure inside execute

when I add this it begins to crash



            # Stars color function of size ?
    
            if mag <= magsize :
    
                print ('mag =',mag, ' magsize=',magsize )
    
                if  -5 < mag  <=1:
                    col_name ="red1"
    #                setMaterial(bpy.context.object, red1)
    
                    ob8 = spherered1.copy()
                    ob8.location = ( XC, YC, ZC )
                    bpy.context.scene.objects.link(ob8)
#                    dim1 = ob8.dimensions
                    cr+=1
    #                bpy.context.object.hide = False
                    ob8.name = starname; ob8.data.name = starname
                    ob8.scale = (( starsize1 * ob8.scale[0], starsize1 * ob8.scale[1]  , starsize1 * ob8.scale[2]) )

                    ob8.hide = False
    
    



should there be something for the mesh data may be ?

also should I do the link after the loop to be faster ?

thanks

modified the procedure doing the link outside



					ob8 = spherered1.copy()
					ob8.location = ( XC, YC, ZC )
					ob8.name = starname
					ob8.scale = (( starsize1 * ob8.scale[0], starsize1 * ob8.scale[1]  , starsize1 * ob8.scale[2]) )
					ob8.hide = False
					ob8.data = ob8.data.copy()			# also duplicate mesh, remove for linked duplicate
	
					oblist1.append(ob8)
					cr+=1




the time is faster!

but still error on properties and crashes !

any idea why it is crashing on properties change

thanks

anyone can help figure out why it is crashing

I mean script works fine until try to change one button then it crashes !

thanks