How to change the document type of a CCB file in SpriteBuilder? - spritebuilder

I have created a CCB file as a Scene now I would like to change it into a Layer because I want the size of the CCB file to be larger than one screen.
Is there a way to do this?

Officially SpriteBuilder doesn't allow you to change the document type of a file, however, there is a way around this. The information about the size type is stored in the CCB file.
Close SpriteBuilder (to avoid that the cache overrides your changes to the CCB file)
Open the CCB file of the Scene that you want to change into a Layer with a text editor of your choice. Search for the docDimensionsType. As of SpriteBuilder 1.1 the value of this entry corresponds to this enum:
enum {
kCCBDocDimensionsTypeFullScreen,
kCCBDocDimensionsTypeNode,
kCCBDocDimensionsTypeLayer,
};
So if you want to have a layer, change that value to 2.
Reopen the project in SpriteBuilder and you will now see that you
can change the size of the stage, you now have a Layer instead of
Scene.

Related

Why is object in AOT marked with red cross?

I have to extend report's query to add a new field.
I've created extension of a query, joined required datasources and can see new field in the list of fields.
For some reason the report in the AOT is displaying with red cross sign:
In properties i can see error in metadata: "There was an error reading metadata. Make sure the metadata xml file(s) are accessible, are well formed and are not corrupted with duplicate or missing xml elements.
The exception message is: Element named: 'Copy1' of type 'ModelElement' already exists among elements: 'Copy1'.
Parameter name: item
Additional information:
AOT/Reports/Reports/WHSInvent"
There is an .xml of that object in packages local directory, there are no any duplicate names in any node of that report.
Any ideas how it can be fixed?
I've run into this before and there are a two things that come to mind.
Often times it's due to an incorrect merge where changes are merged and metadata is accidentally duplicated (in your case it's possible there are two xml nodes with the same name/id in the .rdl file)
If this report is checked in with corrupt metadata, you need to manually modify the RDL file, which is not great, but hopefully the error contains enough hints. Open the report rdl file in your favourite editor (report likely located in a similar path as this: K:\AosService\PackagesLocalDirectory\YOURMODEL\Reports) and look for an xml node with an attribute Name="Copy1". With luck, you have two duplicate nodes next to each other due to the merge. Remove the offending duplicate node, save, and refresh the AOT in Visual Studio.
If the error is in your local changes only (xml file is corrupted for whatever reason) and you are sure that your source control contains the correct version and you simply wish to overwrite the local contents with the source controlled version, follow these steps. Note: this will overwrite local changes.
First, undo pending changes.
Then force a get latest:

Where is Atom keeping its state?

I'm on OSX and had a file open in Atom which I hadn't given a name to. I had to restart my computer and when it came back again I clicked the wrong thing and it forgot all the old file names, and the unnamed file seems to be gone without a trace. If I use Time Machine to restore the .atom file to an old state it detects that something is 'wrong' and pulls the most recent state from some other location (it gets recent filenames from somewhere). Any idea where it's getting that state from?
The literal answer to my question, found using some aggressive grepping, is ./Library/Application Support/Atom/IndexedDB/file__0.indexeddb.leveldb.
It appears to be that the dialog which caused Atom to forget my file list was shown as the result of a real bug rather than bad intentional UX.
Here are the instructions which got my file contents back (courtesy someone in the Atom slack channel):
Open the Chrome Dev Tools in Atom using Cmd + Option + I
Click the Application tab
In the tree view on the left of this tab, expand IndexedDB > AtomEnvironments and click on the table states
In the grid on the right, you'll see one or more entries keyed with editor-<some hash>
For each of those entries, expand the Object in the Value column and then expand this tree: Object > value > project > buffers
For each file in the "buffers" list, expand it and try to find the untitled file, it won't have a filePath property. The text field will have the file contents.

WARNING: All changes made in this file will be lost

So I have a general question. When you convert your .ui file into a .py file with pyuic, on the top part of the .py file it says:
WARNING! All changes made in this file will be lost!
Is is serious ? How will changes made in the file lost ?
I'm sorry I realise this is not a smart question but I just want to make sure what this is about and that it will not comprise anything afterwards!
Since this is a generated file, it is a result, not a source. Thus:
When you distribute your project, you shouldn't be distributing that file. So, whatever you do to the file, won't reach your customers anyway.
Whenever your project is built and the source .ui file is changed, the output will be regenerated - and whatever changes you made to the output file, thus lost.
What this means is: You’ve used a .uic file to generate a .py file, therefore if you modify the later manually ( i.e : create a class , or adding a comment etc...) and subsequently re-generate a file via puic those will be lost.
That’s why you should create a main.py file and import the generated .py file into it leaving the original untouched.
If at a later stage you need to add a button and a label for example, you do so via qdesigner which gets you your new .uic file you create a .py
with the puic and voila your gui is modified your old .py erased by the new one but everything in your main.py stays the same.
Hope this makes sense..
Provided you have generated .py file from the .ui file and will not be making any changes in the .ui file, changes will persist.

How to undo TTW changes to dexterity content type

I have notices that types created with paster on the file system can be changed using the TTW editor.
When I reinstall the product the TTW changes persist, and the model file seems to be ignored. How can I discard these changes? Is there a guide to the relationship between web changes and file system changes?
A content type's entry in the portal_types tool has 3 properties related to where the model is loaded from. They are checked in this order:
model_source: The XML model, inline
model_file: Path to a file which contains the XML model
schema: Dotted path to a Python schema
My guess is that you need to make your filesystem product's installation profile explicitly empty model_source, so that it won't take precedence over model_file and schema.

How can I programmatically add build files to Xcode4?

I've been trying to figure out how to programmatically add files to an Xcode4 project and it seemed like AppleScript would be the way to go, however I'm running into "missing value" errors.
Here's the code I've got:
tell application "Xcode"
set theProject to first project
set theTarget to first target of theProject
set theBuildPhase to compile sources phase of theTarget
tell first group of theProject
set theFileRef to make new file reference with properties {full path:"/Users/jeff/Projects/XcodeTest/XcodeTest/MyViewController.h", name:"MyViewController.h", path:"XcodeTest/MyViewController.h", path type:group relative}
add theFileRef to theProject
end tell
--tell theBuildPhase to make new build file with properties {build phase:theBuildPhase, name:"MyViewController.h", file reference:theFileRef, target:theTarget, project:theProject}
end tell
I've tried the commented-out line instead of the add-command as well, but that doesn't work either (I get "missing value").
The 'add' error is:
error "Xcode got an error: file reference id \"251AD3431432472E006E300F\" of Xcode 3 group id \"251AD32C14324645006E300F\" of project \"XcodeTest\" of workspace document \"XcodeTest.xcodeproj/project.xcworkspace\" doesn’t understand the add message." number -1708 from file reference id "251AD3431432472E006E300F" of Xcode 3 group id "251AD32C14324645006E300F" of project "XcodeTest" of workspace document "XcodeTest.xcodeproj/project.xcworkspace"
The "make new reference" does add the file to the list of files in Xcode, but I also need it to be added to the project target so that I can add actions and outlets to the file from Xcode w/o having to first check the checkbox to add it to the "target membership".
I ended up sending this question to the devs on the xcode developer list and the response I got was effectively "you can't".
This appears to be completely broken in Xcode4, but I've seen a project that does it. I think what they are doing is parsing and modifying the "project.pbxproj" file directly. (this file is hidden inside the xcodeproj bundle)
The file is a GUID soup, but once you look at it for a while it seems possible to safely modify it, especially if you are only adding stuff.
Edit:
Found this stackoverflow answer that might help.
Tutorial or Guide for Scripting XCode Build Phases
There is a poorly documented user defined build setting that can be added. Files can be both excluded and included from compilation
Go to your target's Build Settings > Tap the + button > Add User-Defined Setting
The key is either INCLUDED_SOURCE_FILE_NAMES or EXCLUDED_SOURCE_FILE_NAMES
The value is a space separated list of file paths
See reference:
http://lists.apple.com/archives/xcode-users/2009/Jun/msg00153.html

Resources