a1studmuffin / SpaceshipGenerator

A Blender script to procedurally generate 3D spaceships
Other
7.68k stars 437 forks source link

reports an error when i try to add spaceship #51

Open Enda111 opened 2 years ago

Enda111 commented 2 years ago
Screen Shot 2022-04-13 at 6 45 32 PM

Report: Error Python: Traceback (most recent call last): File "/Users/enda/Library/Application Support/Blender/3.1/scripts/addons/add mesh SpaceshipGenerator/init.py",line 43, in execute spaceship generator.generate spaceship( File "/Users/enda/Library/Application Support/Blender/3.1/scripts/addons/add mesh SpaceshipGenerator/spaceship generator.py", line 669, in generate spaceship add surface antenna to face(bm, face) File "/Users/enda/Library/Application Support/Blender/3.1/scripts/addons/add mesh SpaceshipGenerator/spaceship generator.py", line 341, in add surface antenna to face result = bmesh.ops.create cone(bm, TypeError: create cone: keyword "segments" expected an int, not float location: :-1

RetroFromTheEmpire commented 2 years ago

I also have this issue; did you find a solution? :)

Phildatlante commented 2 years ago

Same here.

don1138 commented 2 years ago

To fix this, open spaceship_generator.py and change line 340 from: num_segments = uniform(3, 6) to num_segments = randint(3, 6)

Agroithien commented 2 years ago

> To fix this, open spaceship_generator.py and change line 340 from: num_segments = uniform(3, 6) to num_segments = randint(3, 6)

I tried this but another error came on please help!!! Screenshot (33) ut...

YuzhouGuo commented 2 years ago

To fix this, open spaceship_generator.py and change line 340 from: num_segments = uniform(3, 6) to num_segments = randint(3, 6)

I tried this but another error came on please help!!! Screenshot (33) ut...

Hey there, I just came along with the same issue. If you reach out to the latest blender API website you may see that they change the argument namings: https://docs.blender.org/api/current/bmesh.ops.html. I guess the name used to be "diameter" but apparently it is now "radius". So just change all "diameter1" "diameter2" to "radius1" and "radius2" you should be fine.

don1138 commented 2 years ago

Ah, Yes! Thanks for detailing the solution!

I found that ldo had forked it and got it working, but hadn't yet done a DIFF to see what they had changed.

Enda111 commented 2 years ago

i also changed so instead of saying diameter1=0, it looks like. dont know if this helps for any bugs or anything :)

Screen Shot 2022-05-04 at 4 28 30 PM

s

don1138 commented 2 years ago

It looks like you need to change all instances of uniform() to int() or radint()

(and make those values whole integers; so no 0.001, only 1)

and all instances of diameter1 and diameter2 to radius1 and radius2.