Given an Object
pointer which I know is of some curve, how do I query whether it refers to a NURB or a Bezier curve?
Seems to be OB_SURF
, OB_CURVE
. and later, Nurb *nu; nu->type == CU_BEZIER
vs CU_NURBS
or CU_NURBS_CYCLIC
. haven’t looked at their differences though.
See under
else if (ELEM(obedit->type, OB_CURVE, OB_SURF)) { /* OB_FONT has no cu->editnurb */
and under
static void curve_select_less(Object *obedit)
Thanks, @ankitm!
Did you just pull this info out of the hat or is there a way to systematically find it? I’m not used to working on such large codebases, so get lost at times…
I had seen OB_MESH while working on my own thing. so I figured there will be more.
Many ways to search though:
- Regex: I only know one & it helps a lot:
abc.*xyz
: matchesabc_random_word_xyz
. - Guess which features should be using such information. Modifiers are full of mesh related modifications. Similarly, exporters will be going over the whole scene, so they need to filter out unrelated things. So search only those folders.
- Brute force search: go over all the results (IDE should facilitate it)
- Reduce the size of the code base you’re working on. I had seen you asked about
make debug developer
. That is not useful for the task you claimed (I receive emails).make lite
is best for many purposes. - See the commit too that broke it. https://developer.blender.org/rBfe0036c586d334a17a0b6bc008790749f58273be That itself has what you were searching for.
The more you search, the better you know the code.
Thank you very much @ankitm for your advice.
Using make lite
has really sped up things for me.
While trying to fix the bug, I did look through the commit you mentioned, which pin-pointed the source of trouble. But I didn’t search for other info in the file as you pointed out, and I guess this would help me further.
Thank you, once again!