Post

Replies

Boosts

Views

Activity

Reply to protocols + variables + type issue
there is a parent class to the classes that are CNEnvelopment.so the child classes are something like :public class CNNode : CNDagObj, CNIdentity, CNProperties, CNEnvelopment, CNStackObj, CNDagConnection, BKObserver, CNRenderable, CNOutputsObj {CNDagObj is the parent class. Not all CNDagObjects are CNEnvelopment.the Property in which we find the CNEnvelopment, is of the class CNDag.public var parent : CNDagObj? = nilall objects that will be a parent, will also be CNEnvelopment, But as I recall... the compiler doesn't like it if I do this instead :public var parent : CNEnvelopment? = nilso I'm stuck with the next lowest common denominator class (CNDag) i suppose i should :if let envelope = theParent as? CNEnvelopment{?
Jun ’20
Reply to Metal Perspective Martrix issue
the net result was: the book I was following made assumptions that turned out to be wrong. The code in the book could never work. the Matrix4x4 structure in the book assumes a row layout in the the float4x4 used in Metal. It doesn't work like that. it uses a Column layout. ie: the matrix I built from the tutorial assumed that each simd_float4 passed in was going to be a row. instead it was a column. this screwed up everything. but I also had issues with the matrix weirdly breaking my identity values. that screwed up everything. and my rotation function, was faulty.
Oct ’20
Reply to Mac swift Xib based doc app deletes a doc when I make changes and then save it.
here is what caused that issue: when you save the file for the very first time, your identifier is exactly the way you type it in in the text field. here's mine: com.BkTools.blockingDoc when you save changes to a file, the identifier is lowercased: com.bktools.blockingdoc I actually test for my type identifier, because I will probably need to have more than one. So I uses a Switch. and the list of options needs to be exhaustive, so I have a Default: option that returns an empty Data() But that should never get called. under any circumstances. I have a closed loop here. I am saving MY file type, I Am opening MY file type. I have written down MY identifier, so I can Expect MY file identifier. except. I can't. Somebody transforms my identifier before I get it. which is a cardinal sin. WORSE, they transform my identifier, only SOME of the time. which in my book is far far worse a cardinal sin. the workaround... when I inevitably run into this problem again and there's no documentation then either: is to either use all lowercase in the identifier, or to use the convenience method : lowercase() on the string in the switch and just check for the lower case version. half a day looking for that little gem.
Nov ’23