Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blender 4.1 / BoxCutter compatibility #9

Open
AVA3d opened this issue Apr 1, 2024 · 96 comments
Open

Blender 4.1 / BoxCutter compatibility #9

AVA3d opened this issue Apr 1, 2024 · 96 comments

Comments

@AVA3d
Copy link

AVA3d commented Apr 1, 2024

Hey Damjan,

Today I've finally installed the latest Blender 4.1.1. There are some compatibility issues with BoxCutter.
https://github.com/eXzacT/RePrimitive/assets/84742853/7100afea-e345-4c9c-88f8-d3de24c63a9c

And also get errors sometimes (50/50) if a mesh has a loop cut:
https://github.com/eXzacT/RePrimitive/assets/84742853/53a49373-4fd6-4a06-a1f6-6184d35d7d89

Take a look please

@eXzacT
Copy link
Owner

eXzacT commented Apr 1, 2024

Yeah as I said, loop cuts are no longer supported when the addon needs to find out which shape it is, I would have to think of a different way, I don't wanna say it's impossible but it's really hard.

Can you further explain what's wrong with 4.1, it creates a new object?

@eXzacT
Copy link
Owner

eXzacT commented Apr 1, 2024

The workaround you can use for now is directly use the reprimitive_circle/cone/cylinder etc because you bypass the find_object_type

@AVA3d
Copy link
Author

AVA3d commented Apr 1, 2024

Yeah, it creates a new object without modifiers. But the old one stays as well:
2024-04-01_1

@eXzacT
Copy link
Owner

eXzacT commented Apr 1, 2024

are you sure it's connected to boxcutter or it doesn't work in general

@AVA3d
Copy link
Author

AVA3d commented Apr 1, 2024

The workaround you can use for now is directly use the reprimitive_circle/cone/cylinder etc because you bypass the find_object_type

The same

are you sure it's connected to boxcutter or it doesn't work in general

It looks like there are no problems if I add the same modifiers manually. Only if I add them via BC
Can this be the reason?
2024-04-01_2

Attaching a blend. file. You can check yourself:

BC-4.1bug.zip

@eXzacT
Copy link
Owner

eXzacT commented Apr 1, 2024

Okay I'll check why it doesn't work for loop cuts then,
As for the other issue it seems to just be a collection problem again, it's not about boxcutter, if you make any collection and put the object in and run reprimitive it will also be linked in the main collection, they must have changed some code related to collections, I have to check it out

@eXzacT
Copy link
Owner

eXzacT commented Apr 1, 2024

Actually I'm on 4.0 and it happens to me too, so it's not because of the version

@AVA3d
Copy link
Author

AVA3d commented Apr 1, 2024

a collection problem again

It also happens with one collection only

@eXzacT
Copy link
Owner

eXzacT commented Apr 1, 2024

Should be fine now, can you send me the blend where you had the issue with loop cuts?

@AVA3d
Copy link
Author

AVA3d commented Apr 1, 2024

I haven't saved it unfortunately, and can't reproduce it now...

@AVA3d
Copy link
Author

AVA3d commented Apr 1, 2024

Ok, I could reproduce it:
loop_bug.zip

It also happens in B4.0. So it isn't 4.1 related

@eXzacT
Copy link
Owner

eXzacT commented Apr 1, 2024

I could save myself a huge headache if instead of using reprimitive on blender default objects I made it so people have to add primitive shapes through the addon, and those objects would have all the data saved as custom properties, there would be no need for any calculations anywhere, loop cuts would work out of the box and performance would be better but I think people wouldn't like having to use those custom primitives

The other way to do it would be run the calculations only the first time you run them on a primitive, store all the results as custom properties, then if you added loop cuts those properties wouldn't change and I could reapply the loop cuts after changing the object

The last way is find a better way to calculate which object type something is which I don't think I'm smart enough for

image
What I'm doing right now is so ugly but it works if there's no loop cuts

@AVA3d
Copy link
Author

AVA3d commented Apr 1, 2024

As I said in another topic - you might delegate to a user to choose which object type to modify. This might be a huge time/headache saver for you in terms of coding I guess :)

@eXzacT
Copy link
Owner

eXzacT commented Apr 1, 2024

If it was like that from the beginning people would accept it but right now it's a downgrade if they have to say which object it is

@eXzacT
Copy link
Owner

eXzacT commented Apr 1, 2024

I could just ignore loop cuts because after all it is destructive workflow
core.zip
You can just replace the core.py with this it should fix the collections and loop cut for now, it won't work if you applied the rotation though and it won't reapply the loop cut
I have to do big refactors again so next version will probably come out at the end of the week

@AVA3d
Copy link
Author

AVA3d commented Apr 1, 2024

core.zip

Replaced, but it isn't working
2024-04-01_3

@eXzacT
Copy link
Owner

eXzacT commented Apr 1, 2024

Oh I'm sorry, I need to send you the other one too
operators.zip

@AVA3d
Copy link
Author

AVA3d commented Apr 1, 2024

The same unfortunately:

RePrimitive_B4.1.1-BC_02.mp4

@eXzacT
Copy link
Owner

eXzacT commented Apr 1, 2024

It's not a collection issue then, that was a separate thing, could you send me that blend file too? Perhaps I need to have boxcutter in order to test it

@AVA3d
Copy link
Author

AVA3d commented Apr 1, 2024

Yep, as I said :)
Here it is:
BC-4.1bug01.zip

@eXzacT
Copy link
Owner

eXzacT commented Apr 1, 2024

did u copy paste the object and try on 4.0?

@AVA3d
Copy link
Author

AVA3d commented Apr 1, 2024

I opened the file in 4.0 - it works without any problem

@eXzacT
Copy link
Owner

eXzacT commented Apr 1, 2024

Okay I'm downloading 4.1 to check

@eXzacT
Copy link
Owner

eXzacT commented Apr 1, 2024

core.zip

Can you try it now please, your blend file worked fine, there's a slight bug with naming but it was there before the object will shift back and forth between some names.
The problem was shading as you said they changed it in 4.1, I'm not sure if I can get a difference between shade smooth and shade smooth by angle anymore, so I just set it to be shade smooth by angle as I don't think anyone uses the previous one

@AVA3d
Copy link
Author

AVA3d commented Apr 2, 2024

At first glance it looks like you fixed it! 👍
But let me test it more thoroughly, including this new shading system

@eXzacT
Copy link
Owner

eXzacT commented Apr 2, 2024

I'm cooking really big refactors, the addon should be lightning fast next release, also figured out how I'll reapply loop cuts :D

@eXzacT
Copy link
Owner

eXzacT commented Apr 10, 2024

RePrimitive.zip

Can you give it a shot? There's a known bug with scale, if you change the scale and call the reprimitive it will calculate the location wrong but I'll fix it, other than that everything should work fine except I didn't add readding loop cuts yet
Also maybe there will be some clashes with other addons but I'm not sure, everything works fine on my end

@AVA3d
Copy link
Author

AVA3d commented Apr 10, 2024

Sure! If you need any testings just let me know - it's the least I can do to help you with the addon :)
Downloading it atm

@AVA3d
Copy link
Author

AVA3d commented Apr 10, 2024

It looks like something is missing - both the hotkey and my pie-menus do nothing with this version.

@eXzacT
Copy link
Owner

eXzacT commented Apr 10, 2024

it needs to be on a newly added object, doesn't work if the primitive is already there

@eXzacT
Copy link
Owner

eXzacT commented Apr 27, 2024

image
I don't think I can make it prettier with default blender behavior, I can't make it the same way you did with the pie addon

@eXzacT
Copy link
Owner

eXzacT commented Apr 27, 2024

Is this the behavior you want with linked objects? Or do you want all of them to keep their rotations?

Keeling their rotation is essential, as well as scale.

can send the latest version if you need that fix asap

No hurry, thanks. I'll wait

I can do the same thing with multiple objects at the same time even if they're not linked

I think this could be handy! One pop-up and transformation into the same shape of all selections would be the best.

Do you mean the same thing I said, for example selecting a torus, cylinder and cone(cone was selected last)
if you ran the operator all 3 would become cones

@AVA3d
Copy link
Author

AVA3d commented Apr 28, 2024

Wow, you've made it! Cool menu!
People will love it! :)

selecting a torus, cylinder and cone(cone was selected last) if you ran the operator all 3 would become cones

Yes, the same thing. And besides selecting the last, it would be handy if it could work with the menu above also

@eXzacT
Copy link
Owner

eXzacT commented Apr 28, 2024

Yeah I basically rewrote everything past 2 weeks :D

Yep it would work with the menu, but by default the last one would be highlighted.
So if I understood you correctly,
if you had A cone, then 2 more cones because they were linked from that one and then 2 more objects which aren't linked,
you selected all of them with one of the cones being last, every selected object would keep its transforms but would become cones, now you would have 5 cones with 3 of them being linked and 2 being standalone? Does this cover everything for linked objects and working with multiple selection?
I'm guessing with other non linked/selected objects you would want them to keep their modifiers etc same as usual,
but what about linked objects? I've noticed if you link them at some point in time they are the exact same but then you can continue adding modifiers to one of them and it doesn't move to all of them, is that correct? So I couldn't just replace the one selected last and spawn linked objects from with all their transforms intact because maybe some of them had different modifiers?

@eXzacT
Copy link
Owner

eXzacT commented Apr 28, 2024

Is there a default selection in the pie addon you have? It would be really handy as the one I made with Blender doesn't support it I think, my idea was if you just press and release the keybind for pie menu it would run the default option, and the default option would depend on the type of object it is, if you pressed it and held it then you could move the mouse around and pick which one you want(including the default one), but since default options aren't supported the best thing I can do is highlight the default one, the confusing part is if the user releases the button I think they'd expect the highlighted one would be picked but that's not the case, here I'll record a gif so you can see what I mean

@eXzacT
Copy link
Owner

eXzacT commented Apr 28, 2024

My point is, I can definitely see it being annoying having to open the pie menu every time just to select the default one, the workaround would be having 2 different keybinds, 1 for auto(the previous behavior) and 1 for pie
screengif

@eXzacT
Copy link
Owner

eXzacT commented Apr 28, 2024

Also the annoying part with the pie menus is the operator shows up where the mouse was when you picked an option, so in the gif the cone got completely covered by the operator

@eXzacT
Copy link
Owner

eXzacT commented Apr 28, 2024

screengif
How do you insert a loop cut for a cone though

@AVA3d
Copy link
Author

AVA3d commented Apr 28, 2024

if you had A cone, then 2 more cones because they were linked from that one and then 2 more objects which aren't linked,
you selected all of them with one of the cones being last, every selected object would keep its transforms but would become cones, now you would have 5 cones with 3 of them being linked and 2 being standalone? Does this cover everything for linked objects and working with multiple selection?

The thing is that with linked objects there is no need to select all the objects. You just need to select one of them, change it, and all the linked ones will be rebuilt. This is the core idea.
I might be not 100% correct, but as I understand it: Blender get a mesh(Cube00) and link it to objects "Folder1"," Folder2" etc. And we can change this mesh "Cube00" to another, lets say "Sphere00":

LinkedData.mp4

but what about linked objects? I've noticed if you link them at some point in time they are the exact same but then you can continue adding modifiers to one of them and it doesn't move to all of them, is that correct?

Yes, you're right. It links a mesh to objects. And this objects can have different modifiers.

In relation to RePrimitive. Ideally, we should select only one linked object, change/transform it. And after that all other linked objects should be rebuilt accordingly.

Regarding mixing selection of linked and standalone meshes. I don't think it would be a common case, but potentially it's
possible. So yeah, apply last selected primitive, or a primitive from the menu.

@AVA3d
Copy link
Author

AVA3d commented Apr 28, 2024

Is there a default selection in the pie addon you have?

No, there isn't. All pie-menus in different software I know don't work this way. And, to be honest, I don't really like this idea because a pie-menu is about quick access and muscle memory. I would advice to follow default Blender behavior. Let's take the Shading menu(hotkey Z). If there is Click(Down+Up) event, then it opens and holds the menu - a user should either click to a menu-item or escape. If there is Press (Down+hold) event, then it will run a menu item under the cursor without additional LMB click.

@AVA3d
Copy link
Author

AVA3d commented Apr 28, 2024

How do you insert a loop cut for a cone though

I use 2 methods:

  1. Knife tool
  2. Bevel the top
LoopCuts.mp4

@eXzacT
Copy link
Owner

eXzacT commented Apr 28, 2024

I agree with the standard pie menu behavior but the problem is you can't do fast operations with muscle memory because of different presets, if it was just the 6 options for each object without any vertices then you could quickly select all 6 directions

Okay then the only way to do it would be to run the calculations on each object, I'll see what I can do and how fast it performs

Going to be a bit trickier for cones then

@AVA3d
Copy link
Author

AVA3d commented Apr 29, 2024

you can't do fast operations with muscle memory because of different presets

You're right, but you can mitigate it by moving the presets outside the quick access area.
I would recommend to arrange the most important menu items vertically and horizontally.

As an example, in these two menus

2024-04-29_2

I select 2-8, 6-4 items even without thinking, just subconsciously ("If there is Press (Down+hold) event, then it will run a menu item under the cursor without additional LMB click.")
But if I need some other item I open-up the menu and search through it ("If there is Click(Down+Up) event, then it opens and holds the menu - a user should either click to a menu-item or escape")

Both these menus aren't from PME, the 1st one is from keKit addon, the 2nd one is from MACHIN3tools.

if it was just the 6 options for each object

By the way, there are 8 sections you can use. I've been trying several arrangements with the menu items, and the most comfortable for me is the menu I showed several posts above. So If it's possible I would recommend to place Cone and Cylinder at opposite sides vertically or horizontally, as well as Circle and Cube. Cube is 4-sided cylinder:
2024-04-29_1menu

edited

@AVA3d
Copy link
Author

AVA3d commented Apr 29, 2024

There is a menu:
2024-04-29_3Machine

If it can help you to dig into the menu stuff I can attach a file with this menu. It's from MACHIN3tools addon, the addon is v1.4.1(old version for pre-Blender 4 builds) and free. I don't think there are any violations on this regard.
The file:
pies.zip
There are couple of notes from my side like: "# Pie-menu order: 9-15-18-12-11-13-19-17". I tried to add Matcap item to the menu a year or so ago , with my near zero knowledge of Python.

@AVA3d
Copy link
Author

AVA3d commented Apr 29, 2024

An another variant:
2024-04-29_2menu

With this variant you can utilize everything with one hotkey - both the menu and the main RePrimitive command. Or you can add Cube instead of RePrimitive. It's up to you :)
Also, it would be good for usability to add some space as separator between the presets and the cylinder/cone/circles buttons by adding an empty row.

@eXzacT
Copy link
Owner

eXzacT commented Apr 29, 2024

There is a menu: 2024-04-29_3Machine

If it can help you to dig into the menu stuff I can attach a file with this menu. It's from MACHIN3tools addon, the addon is v1.4.1(old version for pre-Blender 4 builds) and free. I don't think there are any violations on this regard. The file: pies.zip There are couple of notes from my side like: "# Pie-menu order: 9-15-18-12-11-13-19-17". I tried to add Matcap item to the menu a year or so ago , with my near zero knowledge of Python.

Interesting, I have to dig into the code, I think this could potentially work and instead of having presets shown in the menu immediately, I'd show them in the big menu like that one, also it wouldn't just be verts but it could be an entire preset, with radius, height, etc, what do you think about that one?

@eXzacT
Copy link
Owner

eXzacT commented Apr 29, 2024

Oh nevermind the entire menu is always drawn, I thought it would be drawn on selection

@AVA3d
Copy link
Author

AVA3d commented Apr 29, 2024

I've posted this menu for you as an interesting and complex example of coding.
Speaking of usability of this menu.... Well it is not great IMHO. For sure, having a lot of settings in front of you is handy, but it's hard to reach a particular one, especially over and over again. Such a huge menus isn't about muscle memory.
That's why I had to manually modify it and add Matcap item(2) at the bottom even if there is the same item at the right top area.

@eXzacT
Copy link
Owner

eXzacT commented Apr 29, 2024

An another variant: 2024-04-29_2menu

With this variant you can utilize everything with one hotkey - both the menu and the main RePrimitive command. Or you can add Cube instead of RePrimitive. It's up to you :) Also, it would be good for usability to add some space as separator between the presets and the cylinder/cone/circles buttons by adding an empty row.

This would kinda solve it except the bottom one, you can still go over the menu accidentaly and use a preset instead, but yeah I think there's no way around it. It feels very limiting what you can do with the default blender pie menu

@eXzacT
Copy link
Owner

eXzacT commented Apr 29, 2024

the empty row would help, you're right

@eXzacT
Copy link
Owner

eXzacT commented May 1, 2024

image
Do you know if people would potentially make cuts like these? Because if cuts are one sided like this then origin to geometry doesn't quite work

@AVA3d
Copy link
Author

AVA3d commented May 2, 2024

Yep, it's quite possible. Lets say we need to mitigate shading issues, and we need to restrict the area around a cut.
Regarding preserving origin. What do you think of read->store->recall the initial origin of an object?

@AVA3d
Copy link
Author

AVA3d commented May 18, 2024

No news for a long time. How are things going?

@eXzacT
Copy link
Owner

eXzacT commented May 18, 2024

Sorry, I've been real busy with work since everyone else went for a vacation and I'm the only one left, so I didn't work on addon a lot.
Currently I'm left with replacing multiple selected objects.
Can you confirm the following,
You select 3 objects, the last one you select would also have 2 linked objects which you don't have to select,
then once you called the operator whatever options you choose would happen to all 5 objects, but they would all keep their locations, rotations, modifiers, parents, children, materials etc
It's a lot of work and can potentially be really slow, especially if booleans are involved.
I was thinking about doing all that work once you exit the operator or something, not every time you scroll through verts and other data. This way it would only happen once and not many times per second.

@AVA3d
Copy link
Author

AVA3d commented May 19, 2024

Yeah, "hot" season's coming with all vacations and holidays. With plusses and minuses it brings :))

Regarding selection - everything is correct. It's the best solution that can be. But I don't see anything bad if the addon could work separately either for single objects or linked. I hardly can imagine selection all of these objects and convert them at once.

@TK-1214
Copy link

TK-1214 commented Oct 21, 2024

Hey Damjan,

Today I've finally installed the latest Blender 4.1.1. There are some compatibility issues with BoxCutter. https://github.com/eXzacT/RePrimitive/assets/84742853/7100afea-e345-4c9c-88f8-d3de24c63a9c

And also get errors sometimes (50/50) if a mesh has a loop cut: https://github.com/eXzacT/RePrimitive/assets/84742853/53a49373-4fd6-4a06-a1f6-6184d35d7d89

Take a look please

Hi, I actually have similar issues even without Boxcutter. When I change the number of vertices I get a new object for each number... and every object produces an error, AttributeError: 'Mesh' object has no attribute 'use_auto_smooth'. This problem occurs in my Blender 4.1.1 and Blender 4.2.3LTS

@andelkovic-damjan
Copy link

Hello, the gumroad version should work. The problem was Blender changed how autosmoothing works in newer versions.
I think I forgot to make a change on github and blender.
https://exzact7.gumroad.com/l/reprimitive
You can just enter 0 and get it for free there aswell.

@TK-1214
Copy link

TK-1214 commented Oct 21, 2024

Hello, the gumroad version should work. The problem was Blender changed how autosmoothing works in newer versions. I think I forgot to make a change on github and blender. https://exzact7.gumroad.com/l/reprimitive You can just enter 0 and get it for free there aswell.

Hmmm, yeah the duplicating is fixed. But FixRotation for objects like cubes which worked up until 1.2.1 and did not in 2.0 and 2.0.1, now doesn't make it a default cube, but a cube rotated by 45° because it turns it into a cylinder set to 4 vertices and radius sqrt(2) which you can see when using "RePrimitive" on the object (what did not work at all on cubes earlier). It's a bit confusing :)

@andelkovic-damjan
Copy link

Rotating cube was never even planned, I only made the fix rotation because I needed to do it in case it was applied for objects.
And since it was made for primitives which have some settings unlike cube which is always a cube, then the rotation wasn't written for it either. If it worked before it was purely accidental :D
But try going into edit mode, select the top face and then run fix rotation?

@TK-1214
Copy link

TK-1214 commented Oct 21, 2024

Rotating cube was never even planned, I only made the fix rotation because I needed to do it in case it was applied for objects. And since it was made for primitives which have some settings unlike cube which is always a cube, then the rotation wasn't written for it either. If it worked before it was purely accidental :D But try going into edit mode, select the top face and then run fix rotation?

Doing it in Edit Mode gives the same result as in Object Mode...

Well, I understand what you're saying, a cube is always a cube, but with an applied rotation it is a similar hassle to revert it as it is for other objects, find faces where you know how they should be oriented etc.

And let's say with a somehow rotated cube manually scaled to some arbitrary other size than default, then scale and rotation applied afterwards... and now you want to change the edge length to exactly 3 m... not an easy if not impossible task for the average user. Something which your addon would be perfect for if it did with cubes what it does with cylinders. ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants