Please help: Fiber 2.03 crashes blender every time

I have searched the forum for this problem but not found any solution. Didn’t get any help in #blenderchat either so my last hope is to ask here :slight_smile:

This is what I do:

  1. Open up blender and add a plane
  2. Open text editor and load Fiber, alt-p
  3. Generate some fibers (the number of faces doesn’t matter it crashes with any number)
  4. add a material to the fibers

Now, if I try to regenerate the fibers, either by selecting the plane and re-run the script or by deleting the fibers first and then run the script with the plane selected, blender crashes (no info in the console).

I have tried the trick with adding the material to a second plane first and then making a link to the fibers, same behaviour. :frowning:

Surely there must be ways to get this working. Fiber seems to be popular (even nominated to the script awards) so there must be people using it successfully.

Can anyone help me with this? I would be extremely happy if I could get fiber to work properly …

BTW I use Blender 2.34 on win2k

**** edit ****
tried to unlink the material from the fibers before trying to regenerate them, but still crashing … :frowning:

**** edit again :slight_smile: ****
and I use python 2.3 BTW

// bagge

You can try 2 things. When you reselect the mesh press “Estimate Faces” again. If that doesn’t work open “Fiber2.py” and Alt-P on it (nothing will happen), then run “FiberGUI.py” again.

%<

Ok, I dived into the code to find the error. First python experience but hey, it wasn’t to hard to figure out :slight_smile:

I could trace the error to the last statement in fiber2.py: Blender.Redraw()
If I comment this line out then Blender crashes on the Blender.Redraw() at the end of bevent in fiberGUI.py instead… and if I comment that line also then blender crashes anyway right after finishing bevent

… so I guess the script messes up blender pretty badly so that it crashes whenever it tries to redraw after that …

(I haven’t used python before so I could only use print for debugging :slight_smile: Is there some more powerful way to debug python ??)

// bagge

Thanks! I didn’t think about testing that. Pressing “Estimate faces” didn’t help. If I exit the GUI and delete the fibers then it works to start the GUI again att generate the fibers, but this only works once! And as soon as I try to link a material to the new fibers blender crashes as before … :frowning:

Re-executing fiber2.py doesn’t seem to make a difference …

(I am only generating 4 faces with fiber during these tests)

// bagge

I’ve never had this kind of problem. Generate, delete, reselect, tweak settings, generate, delete etc etc… all with the GUI running. I’m thinking OpenGL problem. Does windoze give you any error message? And do you have any other problems adding materials or textures?

Are your four faces exactly 4, no stray verts, edges, faces? Do you have no more than 8 materials associated with that object?

%<

I’ve had this happen to me, also.

The problem was that Fiber 2.03 didn’t seem to like being ran on a single plane. So the solution (at least for me) was to subdivide the plane once or twice before running Fiber.

I didn’t mention this earlier since I figured that using the Fiber script on a single plane is quite un-common.

I have had several instances of Fiber crashing Blender. The thing that I tried that worked … sort of … was that once I got some fibers … I quit the Fiber script. I know this sounds nuts, but at least I can get the fibers, then I worry about applying materials and textures. In my experience, this is a very buggy script. But it is also very useful. Hoping that somebody is working on refining and putting some error trapping into this script.

No error message from windows. Nope I never had problems with adding materials.

I have no stray verts or edges that I know of and only one material.

I have tried subdividing the plane also. Same results :frowning:

I have tried exiting the script also (even quitting blender in between). But nothing seems to help. I think it is very useful too so I’d really like to have it working. I think it is quite bad that a buggy script can crash blender like that. That’s why I’m leaning towards diving into the blender-code and find out what the reason for the crashes are but I don’t know if I will have time…

Oh well, thanks for all your tips on what to test. I will try a newer build to see if it is the same with that.

Does anyone know how RipSting is progressing with Fiber3??

// bagge

Try it with the latest cvs version and see if you still have problems.

If you do, let me know, and I’ll help you do a proper bug report.

LetterRip

Yes, I admit that the Fiber 2.0x series is very buggy. I definitly have a better grasp of python after coding it. There’s an error in Blender’s interpreter that causes the program to crash when replacing a mesh with another and not assigning the same materials to it before you redraw(). In Fiber 3.0 I make sure that I append all previous materials to the current fibers before I redraw.

Change line 552 and line 925 from:

 NMesh.PutRaw(me,meshname+"_Fiber."+str(objnum))

to


name = meshname+"_Fiber."+str(objnum)
prevobj = NMesh.GetRaw(name)
try:
	for x in range(len(prevobj.materials)):	
		me.materials.append(prevobj.materials[x])
except:
	pass
prevobj = ''

newobj = NMesh.PutRaw(me,name)
if newobj:
	newobj.setName(name)
else:
	newobj = Object.Get(name)
newobj.makeDisplayList()

This patch seems to work. I don’t have time to upload the changes to my website because I need to go to work, but you can copy and Shift+Ctrl+V into Blender (and then replace the whitespace with tabs). Hopefully that will do the trick.

Thanks RipSting and LetterRip! Actually, I did as LetterRip suggested and did a fresh CVS checkout to test it and it was still the same so I started debugging it. I have found what you are referring to about the material assignment (actually it appears to be several bugs in NMesh). I will try to submit a patch for this this tonight or tomorrow.

(actually it is pretty much fixed already I think, I just want to verify it an extra time since it’s my first experience with the blender code)

// bagge

Hi, I just posted the patch to bf-committers. There was two bugs in NMesh that caused the crashes. You can read the post here:
http://projects.blender.org/pipermail/bf-committers/2004-November/008101.html

I did not read your patch carefully enough RipSting, sorry for that. Basically the way the Fiber script works without your patch it should basically only unlink the material from the Fibers (not crash blender). The unlinking of the materials is just i minor thing, but thanks for the patch anyhow.

Just normal fiber generation with Fiber 2.03 is now very stable for me :slight_smile: (I haven’t tested the more advanced features yet…)

// bagge